How to set the text size of a custom tabbar-------iOS

Source: Internet
Author: User

System default Tabbar feel good small, very ugly, so I have to set its own size

We need to

+ (void) load or set in + (void) Initialize

So what's the difference between these two methods?

Can see here: (reprint) HTTP://WWW.JIANSHU.COM/P/9368CE9BB8F9

We're here to use the Load method

In the controller in the custom Tabbar + (void) load{    //Get the Tabbaritem of the current class    uitabbaritem *item = [Uitabbaritem Appearancewhencontainedin:self, nil];        Set all item's selected color    //Set selected text color    //Create dictionary to describe text    nsmutabledictionary *attr = [nsmutabledictionary dictionary];    Text color---Description Rich Text attribute key, NSAttributedString.h    attr[nsforegroundcolorattributename] = [Uicolor blackcolor];< C8/>[item settitletextattributes:attr forstate:uicontrolstateselected];    Set the font size    //font size with normal    nsmutabledictionary *attrnor = [Nsmutabledictionary dictionary] through the normal state;       Set Font    attrnor[nsfontattributename] = [Uifont systemfontofsize:13];        [item Settitletextattributes:attrnor forstate:uicontrolstatenormal];}

How to set the text size of a custom tabbar-------iOS

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.