The process is as follows:
[Java]
<Span style = "font-size: 18px; color: # 3333ff;"> TabWidget tabWidget = tabHost. getTabWidget ();
For (int I = 0; I <tabWidget. getChildCount (); I ++ ){
View child = tabWidget. getChildAt (I );
Final TextView TV = (TextView) child. findViewById (android. R. id. title );
RelativeLayout. LayoutParams params = (RelativeLayout. LayoutParams) TV. getLayoutParams ();
Params. addRule (RelativeLayout. ALIGN_PARENT_BOTTOM, 0); // cancel text bottom edge alignment
Params. addRule (RelativeLayout. CENTER_IN_PARENT, RelativeLayout. TRUE); // you can specify the center and alignment of the text.
} </Span>
However, this is highly uncoordinated, and you need to adjust the height and then change the code.
[Java]
<Span style = "font-size: 18px; color: # 3333ff;"> TabWidget tabWidget = tabHost. getTabWidget ();
For (int I = 0; I <tabWidget. getChildCount (); I ++ ){
View child = tabWidget. getChildAt (I );
Final TextView TV = (TextView) child. findViewById (android. R. id. title );
RelativeLayout. LayoutParams params = (RelativeLayout. LayoutParams) TV. getLayoutParams ();
Params. addRule (RelativeLayout. ALIGN_PARENT_BOTTOM, 0); // cancel text bottom edge alignment
Params. addRule (RelativeLayout. CENTER_IN_PARENT, RelativeLayout. TRUE); // you can specify the center and alignment of the text.
Child. getLayoutParams (). height = 30;
// Final ImageView iv = (ImageView) child
//. FindViewById (android. R. id. icon );
// Iv. getLayoutParams (). height = 0;
}
</Span>