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

  • 相关阅读:
    leetcode -- Add Binary
    leetcode -- 4sum
    leecode -- 3sum Closet
    C++单例模式
    MapReduce的模式、算法和用例
    react 学习笔记
    css3 文字过长用...代替
    scss/css 中添加ie hack
    springmvc 解决跨域CORS
    springmvc 添加Junit4
  • 原文地址:https://www.cnblogs.com/dxmfans/p/9434594.html
Copyright © 2011-2022 走看看