我还在学习关于Android,一边摆弄 TabHost
和 TabWidget
,我不能帮助,但请注意,有没有选择关闭图标。
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 off the icons.
它吃起来,即使我不实际设置的图标到则tabspec
宝贵的空间。请问有什么办法可以减少标签栏的高度?这真的很难找到小图标(在3个不同大小)完全适合我故意这些标签包含。我有零技能的图形。
It's eating up valuable space even when I don't actually set an icon into the TabSpec
. Is there any way to reduce the height of the tab bar? It's really hard to find small icons (at 3 different sizes) that perfectly fits what I intended those tabs to contain. I have zero skills with graphics.
推荐答案
我有这样的:
TabHost tabHost = getTabHost(); // The activity TabHost
添加code添加标签为标签的主机...然后最后
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:
它看起来像35是一个不错的数字。也许它需要针对不同的DPI进行更改。
It looks like 35 is a good number.. Perhaps it needs to be changed for different dpi.
相关推荐
最新文章