简体   繁体   English

如何在ActionBar xamarin android中的当前选项卡上更改文本颜色?

[英]How to change text color on the current tab in ActionBar xamarin android?

I am new in Xamarin, and I try to change the color on my selected tab in a ActionBar like this ? 我是Xamarin的新手,因此尝试在ActionBar中选择的选项卡上更改颜色,就像这样吗?

Example

Just the text color and underline but not the background? 只是文本的颜色和下划线而不是背景?

Thanks a lot 非常感谢

If you are using the design support library add this code to your tabactivity 如果您使用的是设计支持库,请将此代码添加到Tabactivity

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM