zoukankan      html  css  js  c++  java
  • 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
            }
        }
    }
     

  • 相关阅读:
    perl shell交换示例
    python语法测试
    python使用带汉字的正则表达式
    【zz】Perl数字与字符串间的自动转换
    python完成文件按行拆分按列重组。
    转载 python每次读入文件一行的问题(血的教训啊)
    工程总结
    perl 语言学习——从C/C++到perl
    perl双层哈希求长度
    visual studio 代码分析利器 FxCop
  • 原文地址:https://www.cnblogs.com/dxmfans/p/9434594.html
Copyright © 2011-2022 走看看