zoukankan      html  css  js  c++  java
  • Xamarin.Forms 界面布局

     <!--margin表示控件相对StackLayout的位置是设置组件之间的距离,或者距离父组件边缘的距离,
        他的四个值是左边距,上边距,右边距,下边距  -->
        <!--Padding是设置组件内容与组件边缘的距离,他的四个值是左边距,上边距,右边距,下边距-->
        <!--本实例中如果Margin和Padding在同一层级都是stackLayout的话表现结果应该都是一样的-->
        <!--Orientation 有俩个属性 Horizontal:横向排列,Vertical:竖向排列默认竖向 -->
        <!--HorizontalOptions: 浮动填充的概念,Start左浮动,Center中间浮动,End右浮动.这4个属性控件大小根据内容自动,,
        StartAndExpand 向上填充一行,CenterAndExpand 向中间位置填充一行,EndAndExpand 向下位置填充一行,FillAndExpand 填充全部 -->
        <!--WidthRequest对填充一行的设置无效,HeightRequest对FillAndExpand无效 -->
        <StackLayout Margin="30,35,10,30"  Spacing="20" Orientation="Vertical" >
            <!-- Place new controls here -->
            <!--HorizontalOptions:-->
            <Label Text="开始位置"
               HorizontalOptions="Start"
               BackgroundColor="LightGray" WidthRequest="30" HeightRequest="100" />
            <Label Text="中间"
               HorizontalOptions="Center"
               BackgroundColor="LightGray" />
            <Label Text="结束位置,终点位置"
               HorizontalOptions="End"
               BackgroundColor="LightGray" />
            <Label Text="一行填充完整"
               HorizontalOptions="Fill"
               BackgroundColor="LightGray" HeightRequest="100" WidthRequest="30" />
            <Label Text="StartAndExpand"
               VerticalOptions="StartAndExpand"
               BackgroundColor="LightGray" />
            <Label Text="CenterAndExpand"
               VerticalOptions="CenterAndExpand"
               BackgroundColor="LightGray" />
            <Label Text="EndAndExpand"
               VerticalOptions="EndAndExpand"
               BackgroundColor="LightGray" WidthRequest="30" HeightRequest="100" />
            <Label Text="FillAndExpand"
               VerticalOptions="FillAndExpand"
               BackgroundColor="LightGray" WidthRequest="30" />
        </StackLayout>

  • 相关阅读:
    SQL Server 实现Split函数
    15.java设计模式之访问者模式
    14.java设计模式之命令模式
    13.java设计模式之模板模式
    12.java设计模式之代理模式
    11.java设计模式之享元模式
    10.java设计模式之外观模式
    9.java设计模式之组合模式
    8.java设计模式之装饰者模式
    7.java设计模式之桥接模式
  • 原文地址:https://www.cnblogs.com/wxpMamarinFrom/p/11578275.html
Copyright © 2011-2022 走看看