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
            }
        }
    }
     

  • 相关阅读:
    python 协程之Greenlet
    python 协程
    python 多进程通信之Manger
    python 多线程通信之Queue
    python 多进程
    python threading之queue
    python threading之同步条件(Event)
    python threading之条件变量同步(condition)
    python之字符串常用方法
    python之字典操作
  • 原文地址:https://www.cnblogs.com/dxmfans/p/9434594.html
Copyright © 2011-2022 走看看