android-modifying tabwidget font size color and alignment

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.