Don't want icons on my TabWidget

前端 未结 2 397
名媛妹妹
名媛妹妹 2020-12-19 10:25

I\'m still learning about Android, and while playing around with TabHost and TabWidget, I can\'t help but notice that there\'s no option to turn of

相关标签:
2条回答
  • 2020-12-19 11:12

    getTabHost().getTabWidget().getChildAt(0).setHeight(10) method we can set the height for the tabs

    0 讨论(0)
  • 2020-12-19 11:21

    I have this:

            TabHost tabHost = getTabHost();  // The activity TabHost
    

    Add code to add tabs into tab host... and then finally

            tabHost.getTabWidget().getChildAt(0).getLayoutParams().height = 25;
            tabHost.getTabWidget().getChildAt(1).getLayoutParams().height = 30;
            tabHost.getTabWidget().getChildAt(2).getLayoutParams().height = 35;
            tabHost.getTabWidget().getChildAt(3).getLayoutParams().height = 50;
    

    Which (if you do not have pics) results in this:alt text

    It looks like 35 is a good number.. Perhaps it needs to be changed for different dpi.

    0 讨论(0)
提交回复
热议问题