【问题标题】:How to change text color on the current tab in ActionBar xamarin android?如何更改 ActionBar xamarin android 中当前选项卡上的文本颜色?
【发布时间】:2017-05-16 16:44:06
【问题描述】:

我是 Xamarin 的新手,我尝试像这样在 ActionBar 中更改我选择的选项卡上的颜色?

Example

只有文字颜色和下划线,而不是背景?

非常感谢

【问题讨论】:

    标签: android xamarin tabs android-actionbar


    【解决方案1】:

    如果您正在使用设计支持库,请将此代码添加到您的 tabactivity

    tabLayout.setSelectedTabIndicatorColor(Color.parseColor("#FF0000"));
    tabLayout.setSelectedTabIndicatorHeight((int) (5 * getResources().getDisplayMetrics().density));
    tabLayout.setTabTextColors(Color.parseColor("#727272"), Color.parseColor("#ffffff"));
    

    【讨论】:

    • 非常感谢,我会尽快尝试
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-04-29
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多