Android Xamarin.Forms中类似于colorAccent的属性

Android Xamarin.Forms中类似于colorAccent的属性,android,xamarin.forms,Android,Xamarin.forms,在Android AppCompact库中,我们使用colorAccent属性为UI控件(如复选框和文本字段)设置主题。如下图所示 <item name="colorAccent">#43ffd6</item> <item name="colorAccent">#ff6f4d</item> #43ffd6 #ff6f4d 如果我想让Xamarin.Forms在跨平台中发挥作用,是否有类似于此的属性。如果您想在Xamarin.Forms中以主

在Android AppCompact库中,我们使用
colorAccent
属性为UI控件(如复选框和文本字段)设置主题。如下图所示

<item name="colorAccent">#43ffd6</item>
<item name="colorAccent">#ff6f4d</item>
#43ffd6
#ff6f4d


如果我想让Xamarin.Forms在跨平台中发挥作用,是否有类似于此的属性。

如果您想在Xamarin.Forms中以主题方式设置分组元素的样式,那么您可以使用样式()例如

您可以利用此功能提供一种主题样式,可以应用于多种类型的UI对象

如果样式不是您的“东西”(尽管我真的看不出不使用它们的任何理由),那么您可以对有问题的UI对象进行子类化,并创建一个新的可绑定对象,负责设置相关属性


祝你好运

我想补充一点,你仍然可以访问口音,在Android 20+API中设置它们,并应用一些材料设计。见:
var buttonStyle = new Style (typeof(Button)) {
    Setters = {
        new Setter {Property = Button.BackgroundColorProperty, Value = Color.Yellow},
        new Setter {Property = Button.BorderRadiusProperty, Value = 0},
        new Setter {Property = Button.HeightRequestProperty, Value = 42}
    }
}
// apply directly to a single control
var mybutton = new Button {
    Text = "Style Me",
    Style = buttonStyle
};