拉伸分离器不起作用
我有一个(简化的)2x2 网格,里面有三个控件。左侧控件延伸到两行。
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition></ColumnDefinition>
<ColumnDefinition></ColumnDefinition>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition></RowDefinition>
<RowDefinition></RowDefinition>
</Grid.RowDefinitions>
<GridSplitter Grid.Row="0" Grid.Column="1" Height="4" Background="Gray"
HorizontalAlignment="Stretch" VerticalAlignment="Bottom"></GridSplitter>
<GridSplitter Grid.Row="0" Grid.Column="1" Width="4" Background="Gray" Grid.RowSpan="2"
HorizontalAlignment="Left" VerticalAlignment="Stretch"></GridSplitter>
<!-- Simplified content -->
<Button Grid.Row="0" Grid.Column="0" Grid.RowSpan="2">Content</Button>
<Button Grid.Row="0" Grid.Column="1">Content</Button>
<Button Grid.Row="1" Grid.Column="1">Content</Button>
</Grid>
我不明白为什么这些分离器不起作用。
I have a (simplified) 2x2 Grid with three controls inside. The left control strechtes over both rows.
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition></ColumnDefinition>
<ColumnDefinition></ColumnDefinition>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition></RowDefinition>
<RowDefinition></RowDefinition>
</Grid.RowDefinitions>
<GridSplitter Grid.Row="0" Grid.Column="1" Height="4" Background="Gray"
HorizontalAlignment="Stretch" VerticalAlignment="Bottom"></GridSplitter>
<GridSplitter Grid.Row="0" Grid.Column="1" Width="4" Background="Gray" Grid.RowSpan="2"
HorizontalAlignment="Left" VerticalAlignment="Stretch"></GridSplitter>
<!-- Simplified content -->
<Button Grid.Row="0" Grid.Column="0" Grid.RowSpan="2">Content</Button>
<Button Grid.Row="0" Grid.Column="1">Content</Button>
<Button Grid.Row="1" Grid.Column="1">Content</Button>
</Grid>
I can't figure out why these splitters do not work.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我建议在内容后面定义 GridSplitter
I suggest to define the GridSplitter behind the content
这对我有用 -
This one works for me -