【问题标题】:Grid row height网格行高
【发布时间】:2015-10-09 12:05:49
【问题描述】:

我正在尝试将网格中一行的高度增加到我在 XAML 中添加的项目数,我会画出来解释一下,希望有人可以帮助我解决我的问题:

【问题讨论】:

  • Height="Auto" 不起作用?
  • 你尝试过堆栈面板吗?
  • 我会尝试使用堆栈面板,Height="Auto" 似乎没有做任何事情:(

标签: wpf grid row


【解决方案1】:

怎么样:

<Grid>
    <Grid.RowDefinitions>
        <RowDefinition Height="43"/>
        <RowDefinition Height="Auto"/>
        <RowDefinition Height="54"/>
    </Grid.RowDefinitions>
    <Button Grid.Row="0" Content="Title"/>
    <StackPanel Grid.Row="1" Orientation="Vertical">
        <TextBlock Text="Scenario 1" />
        <TextBlock Text="Scenario 2" />
        <TextBlock Text="Scenario 3" />
    </StackPanel>
    <Button Grid.Row="2" Content="Add scenario"/>
</Grid>

这不会扩大窗口,只会扩大网格本身。

【讨论】:

  • 是的,我只需要 Grid 行来增长自己,谢谢 :)
猜你喜欢
  • 2019-02-02
  • 2011-03-02
  • 1970-01-01
  • 2012-01-01
  • 2018-09-03
  • 1970-01-01
  • 2017-11-29
  • 2012-01-09
  • 1970-01-01
相关资源
最近更新 更多