XF相对布局
using System;
using Xamarin.Forms;
using Xamarin.Forms.Xaml;
[assembly: XamlCompilation (XamlCompilationOptions.Compile)]
namespace App6
{
public partial class App : Application
{
public App ()
{
InitializeComponent();
RelativeLayout rl = new RelativeLayout();
rl.Children.Add(new BoxView { Color = Color.Blue, WidthRequest = 150, HeightRequest = 150 }, Constraint.Constant(0), Constraint.Constant(0));
rl.Children.Add(new BoxView { Color = Color.Red, WidthRequest = 150, HeightRequest = 150 }, Constraint.RelativeToParent((Parent)=>Parent.Width-150), Constraint.Constant(0));
rl.Children.Add(new BoxView { Color = Color.Purple, WidthRequest = 150, HeightRequest = 150 }, Constraint.Constant(0), Constraint.RelativeToParent((Parent) => Parent.Height - 150));
rl.Children.Add(new BoxView { Color = Color.Yellow, WidthRequest = 150, HeightRequest = 150 }, Constraint.RelativeToParent((Parent) => Parent.Width - 150), Constraint.RelativeToParent((Parent) => Parent.Height - 150));
MainPage = new ContentPage { Content=rl};
}
protected override void OnStart ()
{
// Handle when your app starts
}
protected override void OnSleep ()
{
// Handle when your app sleeps
}
protected override void OnResume ()
{
// Handle when your app resumes
}
}
}
最新文章
- JUnit备忘录
- devenv命令详解
- Kettle使用介绍
- apache下php无法解析直接显示源代码解
- JVM 性能调优实战之:使用阿里开源工具 TProfiler 在海量业务代码中精确定位性能代码
- Android Studio Linking an external C++ project 时候 报Invalid file name. Expected: CMakeLists.txt
- ConnectivityManager
- 微信公众号开发笔记2(nodejs)
- javascript闭包的妙用——实现函数的重载
- win7下通过easyBCD引导安装Ubuntu16.04(并处理遇到的坑)
- spring-cloud-Zuul学习(四)【中级】--自定义zuul Filter详解【重新定义spring cloud实践】
- android-音量管理
- linux过滤旧文件中的空行和注释行剩余内容组成新文件
- Java基础七(Eclipse工具)
- Flask常用的钩子函数
- 部署harbor1.2.0开启ldap验证
- [Java] Servlet工作原理之二:Session与Cookie
- 关于Unity中的刚体和碰撞器的相关用法(一)
- Select Case 的简单实现
- CSS控制当鼠标滑过时更换图片的效果
热门文章
- 单机/伪分布式Hadoop2.4.1安装文档 2014-07-08 21:16 2275人阅读 评论(0) 收藏
- C#中使用split分割字符串的几种方法小结
- USB 3.0规范中译本 第10章 集线器,主机下行口以及设备上行口规范
- Redis tomcat
- iOS writeTofile 和对象的序列化
- 我的IT成长路——为梦想扬帆起航
- [Postgres] Filter Data in a Postgres Table with Query Statements
- html常用样式margin、border怎么使用
- XMPP之ios即时通讯客户端开发-创建工程添加XMPPFramework及其他框架(三)
- 【18.40%】【codeforces 631D】Messenger