Xaml 列和行

Xaml 列和行,xaml,Xaml,我是新来的,在xaml我是一个不速之客,但我想做以下几点: 获取2列并将第一列拆分为2行 我认为基础是: (我希望第二列稍微大一点) 但是我没有把第一列分开:/ 我试过: <Grid.RowDefinitions> <RowDefinition Height="*"/> <RowDefinition Height="*"/> </Grid.RowDefinitions> 但是我不能指定此定义仅适用于第一列(Grid.col

我是新来的,在xaml我是一个不速之客,但我想做以下几点: 获取2列并将第一列拆分为2行

我认为基础是: (我希望第二列稍微大一点)


但是我没有把第一列分开:/ 我试过:

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


但是我不能指定此定义仅适用于第一列(Grid.column属性在RowDefinition中不可用)

您不拆分行/列,而是告诉内容放置在要跨越的多个列之上。检查Grid.ColumnSpan或Grid.RowSpan属性

因此,基本上,您要做的是采用您开始的内容,定义两行两列,然后指定第二列中的UIElement应跨越两行,例如

<Image Grid.RowSpan="2" Grid.Row="0" Grid.Column="1" />

您不会拆分行/列,而是告诉内容放置在要跨越的多个列之上。检查Grid.ColumnSpan或Grid.RowSpan属性

因此,基本上,您要做的是采用您开始的内容,定义两行两列,然后指定第二列中的UIElement应跨越两行,例如

<Image Grid.RowSpan="2" Grid.Row="0" Grid.Column="1" />

我刚刚接受了它,但最终,我使用了下面的代码,而不是完全按照我构建接口的理念来做

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

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

我刚刚接受了它,但最终,我使用了下面的代码,而不是完全按照我构建接口的理念来做

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

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