The*_*ter 4 word-wrap togglebutton uwp responsive
我在 UWP 应用程序的设置页面上有一个 ToggleSwitch,我注意到 ToggleSwitch 的标题文本无法包装它。当我在电话模拟器中测试该应用程序时,Header 会直接离开页面。知道如何像使用 TextBlock 一样使文本换行吗?
<StackPanel Margin="10,0">
<ToggleSwitch Name="toggleOne" Header="Check this on if you want the app to automatically trigger the zombie apocalypse" Margin="10" />
<ToggleSwitch Name="toggleTwo" Header="Short Sample Text" Margin="10" />
</StackPanel>
Run Code Online (Sandbox Code Playgroud)
您可以HeaderTemplate像这样为 ToggleSwitch添加一个:
<ToggleSwitch
Name="toggleOne"
Margin="10"
Header="Check this on if you want the app to automatically trigger the zombie apocalypse">
<ToggleSwitch.HeaderTemplate>
<DataTemplate>
<TextBlock Text="{Binding}" TextWrapping="Wrap" />
</DataTemplate>
</ToggleSwitch.HeaderTemplate>
</ToggleSwitch>
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
319 次 |
| 最近记录: |