修改字符串对tabhost的文本大小字符串、文本、大小、tabhost

2023-09-08 00:15:23 作者:蛋奶布丁

我想改变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); // 例如。
    }
 
word能把汉字变成英文吗

您可以使用此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.