简体   繁体   中英

Android Tabs appearing very large

I am implementing Tabs in my application, but the height of tab is very huge. I tried to use the following code:

TabHost tabHost = getTabHost();  // The activity TabHost
int iCnt = tabHost.getTabWidget().getChildCount();
for(int i=0; i<iCnt; i++)
    tabHost.getTabWidget().getChildAt(i).getLayoutParams().height /= 2;

but it's not affecting the height of the tab anyhow.

You need to edit the View that is used to create the Tab. See this blog post about customizing the tab host, it'll give you an idea of how to edit the tab height; http://joshclemm.com/blog/?p=136

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM