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 Analysis Service
    Ranet.UILibrary.OLAP
    给Silverlight项目Ranet.UILibrary.OLAP添加客户端调试功能
    编译及安装QCA类库
    关于软件生态环境
    Windows7中操作mysql数据库
    介绍自己
    VS2008技巧收集
    .NET开发不可错过的25款必备工具
    如何做搜索引擎优化(SEO)
  • 原文地址:https://www.cnblogs.com/wxpMamarinFrom/p/11578275.html
Copyright © 2011-2022 走看看