开发者

Android: get height of tab bar?

Is there any way I can get the height of the tab bar in Android? Its getHeig开发者_StackOverflowht() method seems to only return 0.

Thanks!


Try this in your code .

   for (int i = 0; i < tabHost.getTabWidget().getChildCount(); i++) {

            RelativeLayout relativeLayout =(RelativeLayout)tabHost.getTabWidget().getChildAt(i);
            relativeLayout.getChildCount();

            TextView tabhostText = (TextView) relativeLayout.getChildAt(1);

            tabhostText.setTextSize(20.0f); // you can set the TextSize of your tab also
            tabHost.getTabWidget().getChildAt(i).getLayoutParams().height = 30;

        }

It will work .

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜