gpt4 book ai didi

xaml - 无法降低单选按钮宽度

转载 作者:行者123 更新时间:2023-12-01 05:03:57 24 4
gpt4 key购买 nike

我有一个 Windows Phone 项目,但我无法调整单选按钮的宽度。这将我的 textblock 推离了屏幕。这是我的 Xaml 代码:

<StackPanel x:Name="spRadioSelection" Orientation="Horizontal" Margin="0,100" HorizontalAlignment="Stretch">
<TextBlock Text="Staging" FontSize="24" Margin="30,20"></TextBlock>

<RadioButton x:Name="rbStaging" GroupName="ProductionLevel" IsChecked="true" Checked="SelectionChangedHandler" Width="68"/>
<RadioButton x:Name="rbLive" GroupName="ProductionLevel" IsChecked="false" Checked="SelectionChangedHandler"></RadioButton>
<TextBlock Text="Live" FontSize="32" Margin="30,20"></TextBlock>
</StackPanel>

它看起来像这样:

enter image description here

最佳答案

您可以更改 MinWidth 而不是 Width

 <RadioButton x:Name="rbStaging" GroupName="ProductionLevel"  
IsChecked="true" Checked="SelectionChangedHandler" MinWidth="68" />

可能还需要减少 TextBlock 上的边距。希望有帮助

关于xaml - 无法降低单选按钮宽度,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30241225/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com