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

        }

    }

}

最新文章

  1. JUnit备忘录
  2. devenv命令详解
  3. Kettle使用介绍
  4. apache下php无法解析直接显示源代码解
  5. JVM 性能调优实战之:使用阿里开源工具 TProfiler 在海量业务代码中精确定位性能代码
  6. Android Studio Linking an external C++ project 时候 报Invalid file name. Expected: CMakeLists.txt
  7. ConnectivityManager
  8. 微信公众号开发笔记2(nodejs)
  9. javascript闭包的妙用——实现函数的重载
  10. win7下通过easyBCD引导安装Ubuntu16.04(并处理遇到的坑)
  11. spring-cloud-Zuul学习(四)【中级】--自定义zuul Filter详解【重新定义spring cloud实践】
  12. android-音量管理
  13. linux过滤旧文件中的空行和注释行剩余内容组成新文件
  14. Java基础七(Eclipse工具)
  15. Flask常用的钩子函数
  16. 部署harbor1.2.0开启ldap验证
  17. [Java] Servlet工作原理之二:Session与Cookie
  18. 关于Unity中的刚体和碰撞器的相关用法(一)
  19. Select Case 的简单实现
  20. CSS控制当鼠标滑过时更换图片的效果

热门文章

  1. 单机/伪分布式Hadoop2.4.1安装文档 2014-07-08 21:16 2275人阅读 评论(0) 收藏
  2. C#中使用split分割字符串的几种方法小结
  3. USB 3.0规范中译本 第10章 集线器,主机下行口以及设备上行口规范
  4. Redis tomcat
  5. iOS writeTofile 和对象的序列化
  6. 我的IT成长路——为梦想扬帆起航
  7. [Postgres] Filter Data in a Postgres Table with Query Statements
  8. html常用样式margin、border怎么使用
  9. XMPP之ios即时通讯客户端开发-创建工程添加XMPPFramework及其他框架(三)
  10. 【18.40%】【codeforces 631D】Messenger