Created
February 18, 2014 07:51
-
-
Save akbarsha03/9066390 to your computer and use it in GitHub Desktop.
Set height for Tab in TabHost
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class TipoDisp | |
{ | |
public static int alt_tabs(Context cont) | |
{ | |
int alt; | |
int dx, dy; | |
DisplayMetrics metrics = cont.getResources().getDisplayMetrics(); | |
dx = metrics.widthPixels; | |
dy = metrics.heightPixels; | |
if (dx < dy) | |
alt = dy/15; | |
else | |
alt = dy/10; | |
return alt; | |
} | |
} | |
// and then, in the activity use something like this | |
int alt = TipoDisp.alt_tabs(myactivity.this); | |
mTabHost.getTabWidget().getChildAt(i).getLayoutParams().height = alt; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment