【问题标题】:How to change the style of the tab in android tabhost?如何更改 android tabhost 中选项卡的样式?
【发布时间】:2012-07-04 20:26:30
【问题描述】:

我想更改 android tabhost 中标签的样式,我不想只更改背景颜色,而是更改整个样式(例如制作圆角)。

【问题讨论】:

    标签: android android-tabhost android-style-tabhost


    【解决方案1】:

    TabHost 中,您可以放置​​Button 或任何其他具有首选样式的小部件,即使是圆角也可以

    Button myButton = new Button(this);
    myButton.setText("My Button");
    myButton.setBackgroundColor(Color.TRANSPARENT);
    myButton.setCompoundDrawablesWithIntrinsicBounds(0, R.drawable.my_button_drawable_top, 0, 0);
    TabHost.TabSpec myButtonTab = mTabHost.newTabSpec("tab1").setIndicator(myButton).setContent(intentPlayList);
    mTabHost.addTab(myButtonTab);
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2011-05-29
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2018-06-14
      • 2018-12-20
      • 1970-01-01
      相关资源
      最近更新 更多