Uitabbar,uitabbaritem how to set Uitabbaritem font size and color in a dictionary, keep the original color (ITEM5)

Source: Internet
Author: User

#import "ViewController.h"


@interfaceviewcontroller ()


@end


@implementation Viewcontroller


-(void) Viewdidload {

[superviewdidload];

Additional setup after loading the view, typically from a nib.

// set screen background color

self. View. BackgroundColor = [uicolorlighttextcolor];

// Initialize Uitabbar

    Uitabbar* TabBar = [[UitabbarAlloc]initWithFrame:CGRectMake(0, Self.View.Frame.Size.Height - the, Self.View.Frame.Size.Width, the)];

// Initialize Baritem

UIImage * imgForItem1 = [UIImageimagenamed:@ "Icon_cinema"];

UIImage * imgForItem2 = [[UIImageimagenamed:@] [ Email protected] "imagewithrenderingmode:uiimagerenderingmodealwaysoriginal];

Uitabbaritem * item1 = [[uitabbaritemalloc]initwithtitle:@ "Cinema" image: imgForItem1 selectedimage: imgForItem2];

< Span style= "COLOR: #000000" >    uitabbaritem * item2 = [[ uitabbaritem Alloc] initwithtitle: @ "2" image:[ UIImage imagenamed: @" more_select_setting " " tag : 101 ];

    &NBSP;

< Span style= "COLOR: #000000" >    uitabbaritem * item3 = [[ uitabbaritem Alloc] initwithtitle: @ "3" image:[ UIImage imagenamed: @" Movie_cinema " " tag: 102 ];

    &NBSP;

< Span style= "COLOR: #000000" >    uitabbaritem * item4 = [[ uitabbaritem Alloc] initwithtitle: @ "Movie" image:[ UIImage imagenamed: @" msg_new " " tag: Span style= "COLOR: #272ad8" >103 ];

UIImage * img1foritem5 = [UIImageimagenamed:@ "start_top250"];

UIImage * IMG2FORITEM5 = [[UIImageimagenamed:@ " start_top250 "]imagewithrenderingmode:uiimagerenderingmodealwaysoriginal];

Uitabbaritem * ITEM5 = [[uitabbaritemalloc]initwithtitle:@ "9" Image: Img1foritem5 selectedimage: IMG2FORITEM5];

Nsbackgroundcolorattributename

// use a dictionary to set the font color of ITEM5

< Span style= "COLOR: #000000" >    nsdictionary * dict = @{ nsfontattributename:[ Uifont systemfontofsize : 18 ], Nsforegroundcolorattributename:[ uicolor Span style= "COLOR: #3d1d81" >yellowcolor ] } ;

// set the font and color of the highlighted state

[item5 settitletextattributes:d ICTforstate:uicontrolstatehighlighted];

nsarray * array = @[item1,item2,item3,item4,item5];

TabBar. items = array;

[Self. View addsubview: TabBar];

}


-(void) didreceivememorywarning {

[superdidreceivememorywarning];

//Dispose of any resources, can be recreated.

}


@end


Uitabbar,uitabbaritem how to set Uitabbaritem font size and color in a dictionary, keep the original color (ITEM5) Uitabbar,uitabbaritem How to set Uitabbaritem font size and color in a dictionary, Keep the original color (ITEM5) Uitabbar,uitabbaritem How to set Uitabbaritem font size and color in a dictionary, keep the original color (ITEM5) Uitabbar, Uitabbaritem how to set Uitabbaritem font size and color in a dictionary, keep the original color (ITEM5) Uitabbar,uitabbaritem How to set Uitabbaritem font size and color in a dictionary, Keep the original color (ITEM5) Uitabbar,uitabbaritem How to set Uitabbaritem font size and color in a dictionary, keep the original color (ITEM5) Uitabbar, Uitabbaritem how to set Uitabbaritem font size and color in a dictionary, keep the original color (ITEM5)

Uitabbar,uitabbaritem how to set Uitabbaritem font size and color in a dictionary, keep the original color (ITEM5)

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.