Windows Phone Gird布局

<Grid x:Name="ContentPanel" Grid.Row="1" Margin="12,0,12,0">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="*"/>
                <ColumnDefinition Width="*"/>
                <ColumnDefinition Width="*"/>
            </Grid.ColumnDefinitions>
            <Grid.RowDefinitions>
                <RowDefinition Height="*"/>
                <RowDefinition Height="*"/>
                <RowDefinition Height="*"/>
            </Grid.RowDefinitions>
            
            <Ellipse Grid.Column="0" Grid.Row="0" HorizontalAlignment="Center" VerticalAlignment="Center" Width="120" Height="120" Fill="Yellow"/>
            <Line Grid.Column="0" Grid.Row="1" X1="10" Y1="5" X2="135" Y2="125" Stroke="Pink" StrokeThickness="20"/>
            <Button Grid.Column="0" Grid.Row="2" Content="王wx" HorizontalAlignment="Center" VerticalAlignment="Center"/>
            <Polygon Grid.Column="1" Grid.Row="0" StrokeLineJoin="Miter" StrokeStartLineCap="Round" Fill="Blue" >
                <Polygon.Points>
                    <Point X="5" Y="6"/>
                    <Point X="26" Y="75" />
                    <Point X="87" Y="165" />
                    <Point X="128" Y="12"/>
                </Polygon.Points>
            </Polygon>
            <CheckBox Grid.Column="1" Grid.Row="1" Content="wwx try" />
            <TextBlock Grid.Column="1" Grid.Row="2" Text="yoyo wwx" FontSize="30" VerticalAlignment="Center"/>
            <Rectangle Grid.Column="2" Grid.Row="0" Fill="Gray" HorizontalAlignment="Center" VerticalAlignment="Center" Height="85" Width="118" />
            <Path Grid.Column="2" Grid.Row="1" Fill="Orange" Data=" M 2,8 L 45,60 c 80,95 140,175 125,30 z" HorizontalAlignment="Stretch" VerticalAlignment="Stretch"/>
            <Slider Grid.Column="2" Grid.Row="2" HorizontalAlignment="Stretch" VerticalAlignment="Center"/>

        </Grid>



通过对行列的分割来进行定位,首先通过 

<Grid.ColumnDefinitions>
                <ColumnDefinition Width="*"/>
                <ColumnDefinition Width="*"/>
                <ColumnDefinition Width="*"/>
            </Grid.ColumnDefinitions>

来进行列的分割

然后通过


 <Grid.RowDefinitions>
                <RowDefinition Height="*"/>
                <RowDefinition Height="*"/>
                <RowDefinition Height="*"/>
            </Grid.RowDefinitions>

来进行 行的分割

然后在相应的子节点中的属性,Grid.Column="0" Grid.Row=“2" 来分别设置在第几个快中,或者跨快。



评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值