【发布时间】:2021-08-07 19:00:10
【问题描述】:
我想更改我的 xamarin 表单 uwp 应用程序的按钮悬停颜色。我可以通过在 uwp 项目的 app.xaml 中应用以下行来实现它。
<Application.Resources>
<SolidColorBrush x:Key="ButtonForegroundPointerOver">white</SolidColorBrush>
<SolidColorBrush x:Key="ButtonBackgroundPointerOver">#08559f</SolidColorBrush>
</Application.Resources>
但它只能在调试模式下工作,而不能在发布模式下工作。如果我为按钮选择自定义渲染器,那么我可以让它工作,但我不希望它在自定义渲染器中完成,因为我必须将应用程序中的所有按钮替换为我的自定义按钮。
【问题讨论】:
-
" 我不希望它在自定义渲染器中完成,因为我必须将应用程序中的所有按钮替换为自定义按钮。" 实际上,您不需要不必将它们变成自定义按钮。你可以create a renderer for one of the built-in view classes。
标签: xamarin.forms uwp