How can we specify width for each tab in tabhost?
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 由 翻译 强力驱动 问题: I am using tabhost in my application. Can we give separate width property for each tab? i.e, one with larger width and other with smaller? 回答1: We can mention the tab width in code like: tabHost . getTabWidget (). getChildAt ( 0 ). getLayoutParams (). width = 50 ; 回答2: I tried below code and it worked perfectly fine for me LayoutParams params = tabHost . getTabWidget (). getChildAt ( 0 ). getLayoutParams (); params . width = 170 ; params . height = 120 ; tabHost . getTabWidget (). getChildAt ( 0 ). setLayoutParams ( params ); you