【发布时间】:2016-07-13 13:45:56
【问题描述】:
是否可以更改 xamarins SwichCell 的文本颜色?
目前我的 SwichCell 中的文本是灰色的,我想将其更改为黑色。
我的 xaml 看起来像这样:
..
<TableView Intent="Data" >
<TableRoot>;
<TableSection>
<SwitchCell Text="Allow Push Notifications"/>
</TableSection>
<TableSection>
<ViewCell>
<ViewCell.View>
<Button Grid.Column="1" Text="Log Out" Clicked="LogOutButtonClick" Margin="-20,-20,-20,-20"/>
</ViewCell.View>
</ViewCell>
</TableSection>
<TableSection>
<TextCell Text="Android Version 1.2.1" TextColor="Black"/>
</TableSection>
</TableRoot>
</TableView>
关于这个我发现here的唯一一件事但这个例子只适用于IOS,其他提供的解决方案使用TextCell和Swich组合,这不适合我的场景(我认为)
有人链接了关于 Swich here 的 stackoverflow 答案。但它不适用于我的情况,因为我使用的是 SwichCell 并且它没有该答案中列出的属性(它也只有一个 android 版本)
【问题讨论】:
-
我认为您的选择是使用具有水平方向 StackPanel 的 Viewcell 或具有标签和开关的网格布局,或者修改 SwitchCell 以实现您自己的自定义文本的自定义渲染器颜色。
标签: c# xaml xamarin xamarin.ios xamarin.android