我试图通过构建 UWP
应用程序让两个按钮在 Visual Studio 的相对面板布局中共享相同的宽度,但似乎无法找到资源或任何东西来告诉我如何做到这一点。
任何人都可以帮助我或给我一些资源吗?请不要在没有建议的情况下降级这个问题。
最佳答案
虽然@al1Dima 提供的Grid
解决方案也是有效的,但这是一个使用RelativePanel
的解决方案
<RelativePanel>
<Button x:Name="LeftButton" Content="Left" HorizontalAlignment="Stretch"
RelativePanel.AlignLeftWithPanel="True" RelativePanel.LeftOf="Divider" />
<Border x:Name="Divider" RelativePanel.AlignHorizontalCenterWithPanel="True"/>
<Button x:Name="RightButton" Content="Right" HorizontalAlignment="Stretch"
RelativePanel.AlignRightWithPanel="True" RelativePanel.RightOf="Divider" />
</RelativePanel>
关于c# - 如何让两个按钮与通用 Windows 平台共享一半的应用程序屏幕宽度,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37934622/