In Android, we can define tabwidget to be paged. In the previous article, it was said that using Tabwidget to define the tab page layout, but most users might think the default font is a little small, but the tab tab default does not set the font size, what if we want to customize the style?
You can control the heading styles in Tabwidget by referring to the following definitions:
(Important: Set the font size, alignment, etc.) for the taps title (int i = 0; i < Tabhost.gettabwidget (). Getchildcount (); i++) {//Get title TextView Tabs_tit Le = (TextView) tabhost.gettabwidget (). Getchildat (i). Findviewbyid (Android. R.id.title); Defines the font size tabs_title.settextsize (16); Defines the alignment textview.setgravity (gravity.center); Defines a high-width textview.getlayoutparams (). height = layoutparams.match_parent; Textview.getlayoutparams (). width = layoutparams.match_parent; }
However, if you want to be more free to define the style, it can only be achieved through a custom method, the specific method should be self-search.
android-modifying tabwidget font size color and alignment