I would like to resize the tabhost in android. I know it is deprecated, but this has been wonderful option for me because I am using ListActivity with custom cursor Adaptor. I am not if this posible with Fragment Tabhost.
Anyways to resize the tab height:
I tried the following:
for (int i = 0; i < tabHost.getTabWidget().getTabCount(); i++)
{
tabHost.getTabWidget().getChildAt(i).getLayoutParams().height = 80;
}
It worked in few phones only. Is there any other way to solve this issue?
Thanks!
Right now, you are setting it in pixels, you should use dp,
try to replace
tabHost.getTabWidget().getChildAt(i).getLayoutParams().height = 80;
with
tabHost.getTabWidget().getChildAt(i).getLayoutParams().height = (int) (80 * this.getResources().getDisplayMetrics().density);
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments