【发布时间】:2020-10-20 00:38:24
【问题描述】:
我们正在开发一个小型应用程序,我们使用自定义渲染创建了仪表板,但我无法更改标签文本颜色。它默认显示标签文本颜色为白色,列表视图背景颜色它将通过 api 出现,因此如果它是白色背景,则标签文本颜色无法看到。在这里,我附上了下面的代码。给我建议来解决这个问题
菜单控件自定义渲染
public static readonly BindableProperty ItemsSourceProperty =
BindableProperty.Create<MenuControl, IEnumerable>(
view => view.ItemsSource,
null,
BindingMode.TwoWay,
null,
propertyChanged: (bindableObject, oldValue, newValue) =>
{
((MenuControl)bindableObject).ItemsSourceChanged(bindableObject, oldValue, newValue);
}
);
public IEnumerable ItemsSource
{
get
{
return (IEnumerable)GetValue(ItemsSourceProperty);
}
set
{
SetValue(ItemsSourceProperty, value);
}
}
【问题讨论】:
-
您可以在 xaml 中分享 ListView 的代码。上面的代码无法帮助我们找出原因。
标签: xamarin.forms visual-studio-2019