修改字符串对tabhost的文本大小 [英] Change the text size of string on tabhost
本文介绍了修改字符串对tabhost的文本大小的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想改变uyari_str的文字大小,但我不能。我的code是:
tabHost.addTab(规范);
鉴于=新的MyView的(这一点,R.drawable.res_tab_uyar);
规格= tabHost.newTabSpec(uyar)。setIndicator(buildIndicator(R.string.uyari_str))。setContent(新TabHost.TabContentFactory(){
@覆盖
公共查看createTabContent(字符串变量){
返回电视;
}
});
解决方案
例如,您的tabhost包括4项在相对布局。
毕竟,你可以使用 getTabWidget()。getTabCount()
来获取选项卡数。
的for(int i = 0;我4;;我++){
RelativeLayout的RL =(RelativeLayout的)tabHost.getTabWidget()getChildAt(i)中。;
TextView中的TextView =(TextView中)rl.getChildAt(1);
textView.setTextSize(15); // 例如。
}
您可以使用此code或像这样的东西。 :)
最好的问候。
I want to change the text size of uyari_str but I couldn't. My code is:
tabHost.addTab(spec);
view = new MyView(this, R.drawable.res_tab_uyar);
spec = tabHost.newTabSpec("uyar").setIndicator(buildIndicator(R.string.uyari_str)).setContent(new TabHost.TabContentFactory(){
@Override
public View createTabContent(String tag) {
return tv;
}
});
解决方案
For example, your tabhost including 4 items in a relative layout.
After all, you can use getTabWidget().getTabCount()
to get tab count..
for (int i = 0; i < 4; i++) {
RelativeLayout rl = (RelativeLayout) tabHost.getTabWidget().getChildAt(i);
TextView textView = (TextView) rl.getChildAt(1);
textView.setTextSize(15); // for example.
}
You can use this code or something like this. :)
Best regards.
这篇关于修改字符串对tabhost的文本大小的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文