zoukankan      html  css  js  c++  java
  • xmarin-xmarin.forms中的Grid使用

    <StackLayout>
                <!--行设的是高度,列设的是宽度-->
                <Grid RowDefinitions="25,*,Auto" ColumnDefinitions="Auto,Auto,Auto">
                    <Label Grid.Row="0" Grid.Column="0" Text="0,0" TextColor="Red" HorizontalTextAlignment="Center" BackgroundColor="Yellow" />
                    <Label Grid.Row="0" Grid.Column="1" Text="0,1" TextColor="Red" HorizontalOptions="Center" BackgroundColor="Purple"/>
                    <Label Grid.Row="0" Grid.Column="2" Text="0,2" TextColor="Red" BackgroundColor="Bisque"/>
                    <Label Grid.Row="1" Grid.Column="0" Text="第二行第1列" TextColor="Blue"/>
                    <Label Grid.Row="1" Grid.Column="1" Text="第二行第2列" TextColor="Blue" />
                    <Label Grid.Row="1" Grid.Column="2" Text="第二行第3列" TextColor="Blue"/>
                    <Label Grid.Row="2" Grid.Column="0" Text="2,0" TextColor="Green"/>
                    <Label Grid.Row="2" Grid.Column="1" Text="2,1" TextColor="Green"/>
                    <Label Grid.Row="2" Grid.Column="2" Text="2,2" TextColor="Green"/>
                </Grid>
                
                <!--Margin默认语法(左,上,右,下)-->
                <Grid RowDefinitions="25,*,Auto" ColumnDefinitions="*,*,*" Margin="0,100">
                    <Label Grid.Row="0" Grid.Column="0" Text="居中且块有背景" TextColor="Red" HorizontalTextAlignment="Center" BackgroundColor="Yellow" />
                    <Label Grid.Row="0" Grid.Column="1" Text="字体有背景" TextColor="Red" HorizontalOptions="Center" BackgroundColor="Purple"/>
                    <Label Grid.Row="0" Grid.Column="2" Text="默认居左显示" TextColor="Red" BackgroundColor="Bisque"/>
                    <Label Grid.Row="1" Grid.Column="0" Text="第二行第1列" TextColor="Blue"/>
                    <Label Grid.Row="1" Grid.Column="1" Text="第二行第2列" TextColor="Blue" />
                    <Label Grid.Row="1" Grid.Column="2" Text="第二行第3列" TextColor="Blue"/>
                    <Label Grid.Row="2" Grid.Column="0" Text="2,0" TextColor="Green"/>
                    <Label Grid.Row="2" Grid.Column="1" Text="2,1" TextColor="Green"/>
                    <Label Grid.Row="2" Grid.Column="2" Text="2,2" TextColor="Green"/>
                </Grid>
                <Label Text="当前组织机构"/>
                <Entry Text="{Binding DataOrgName}" />
            </StackLayout>
    View Code

  • 相关阅读:
    PBE加密 .net 实现
    手把手教你写一个windows服务 【基于.net】 附实用小工具{注册服务/开启服务/停止服务/删除服务}
    fish redux 个人理解
    .net Core 图片验证码 基于SkiaSharp实现
    .net core webapi jwt 更为清爽的认证 ,续期很简单(2)
    js删除数组对象中符合条件的数据
    编译.net .net Core程序 代码,仅做备份
    Mybatis架构相关的知识
    java选择题知识总结大全
    Mybatis详解(二) sqlsession的创建过程
  • 原文地址:https://www.cnblogs.com/lishidefengchen/p/14569167.html
Copyright © 2011-2022 走看看