【问题标题】:How to change segmentBar active Text color in NativeScript Angular 2 Mobile App如何在 NativeScript Angular 2 移动应用程序中更改 segmentBar 活动文本颜色
【发布时间】:2016-12-04 08:23:58
【问题描述】:

我想更改活动 segmentBarItem 的文本和边框颜色。请检查所附图片。

<SegmentedBar class="m-5" #sb [items]="Items"      
    (selectedIndexChange)="onChange(sb.selectedIndex)" borderWidth="0"    
    borderColor="#c2d500" selectedBackgroundColor="green" 
    [items]="[{title: 'News'}, {title: 'Events'}, {title: 'Scan History'}]" 
    borderRadius="0">
</SegmentedBar>

我想将 selectedColor 更改为黑色。现在它的默认活动 segmentBar 文本颜色为白色

Layout Image

【问题讨论】:

  • 你能更清楚地解释你的问题并发布一些你尝试过的代码吗?
  • 我的代码: I想要将 selectedColor 更改为黑色。现在它的默认活动 segmentBar 文本颜色为白色。

标签: angular nativescript angular2-nativescript


【解决方案1】:

问题是 Segmented barselectedbackgroundColor 将像本机组件一样运行。在这种情况下,对于 iOS, selectedbackgroundColor 将改变点击栏的颜色。但是,对于 Android,selectedbackgroundColor 只会改变点击栏的下划线颜色。

【讨论】:

    猜你喜欢
    • 2018-09-15
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2019-02-17
    • 2022-01-20
    • 1970-01-01
    • 1970-01-01
    • 2015-07-10
    相关资源
    最近更新 更多