按钮xamarin的灰色

时间:2017-03-10 19:10:55

标签: xaml xamarin uwp xamarin.forms styles

我写的是Xamarin.Forms PCL。我从“我的按钮”设置了BorderRadius,但是如果我将其设置为禁用或按下它,则显示没有边框半径的灰色边框:

enter image description here

我想清除灰色边框或设置边框半径。

1 个答案:

答案 0 :(得分:1)

  

从Windows 10版本1607(Windows软件开发工具包(SDK)版本10.0.14393.0)开始,generic.xaml包含可用于在不修改控件的情况下修改不同视觉状态的控件颜色的资源模板。在以此软件开发工具包(SDK)或更高版本为目标的应用程序中,修改这些资源比设置Background和Foreground等属性更受青睐。有关详细信息,请参阅Styling controls

的轻量级样式部分

如果您在Application.Resources(Xamarin.UWP客户端项目)中覆盖它,如下所示:

<Application.Resources>
        <SolidColorBrush x:Key="ButtonBackgroundPressed" Color="White" />
        <SolidColorBrush x:Key="ButtonBackgroundPointerOver" Color="White" />
</Application.Resources>

它应该随处可见。

enter image description here

相关问题