如何从开关中删除开/关文本
<Label Text="Below is the binded data: "></Label>
<Label Text="{Binding MyData}"></Label>
<Label x:Name="lbldisp"></Label>
<Switch Toggled="SwitchToggled"></Switch>
Run Code Online (Sandbox Code Playgroud)
如何从开关中删除开/关文本
与SwitchUWP中的相对应的本机控件为ToggleSwitch。如果要删除on/off内容,可以ToggleSwitch直接在UWP项目中创建没有文本样式的内容,如下所示:
应用程式
<Application.Resources>
<Style TargetType="ToggleSwitch">
<Setter Property="OffContent" Value=" " />
<Setter Property="OnContent" Value=" " />
<Setter Property="Margin" Value="0,0,-110,0" />
</Style>
</Application.Resources>
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
2940 次 |
| 最近记录: |