【问题标题】:How to set the bottom line border in tab bar [duplicate]如何在标签栏中设置底线边框[重复]
【发布时间】:2016-01-06 14:02:09
【问题描述】:

set color display in image help me

如何在tabhost中设置指标颜色

【问题讨论】:

    标签: android


    【解决方案1】:

    AndroidManifest.xml 中:

      <activity android:name=".ActivityName" android:theme="@style/tabTheme"/> 
    

    在 values/styles.xml 中:

      <style name="tabTheme" parent="android:style/Theme"> 
      <item name="android:tabWidgetStyle">@style/Widget.TabWidget</item>
       </style> 
      <style name="Widget.TabWidget" parent="android:Theme"> 
      <item name="android:tabStripEnabled">false</item>
    

    tabWidget 在您的 xml 文件中。 添加以下代码

    android:tabStripEnabled="false"
    

    【讨论】:

      【解决方案2】:

      您可以像这样以编程方式更改

      tabLayout.setSelectedTabIndicatorColor(Color.parseColor("YOUR COLOR CODE"));
      

      【讨论】:

      • 我使用的是 Tabhost catrol 而不是 TabLayout
      猜你喜欢
      • 2019-07-11
      • 1970-01-01
      • 2011-06-28
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2020-07-16
      • 2014-06-04
      相关资源
      最近更新 更多