ios - UIBarbutton Item - image selected and un, not shown when called programmatically -


it works in selected state, hence when select either 1 of tabs, when app launched images not visible. (i think there seems problem unselected state , not selected state, because that's 1 not shown or called). anyways' here screenshot demonstrationenter image description here purposes.

here's code use

header file. simple iboutlet uibarbutton item *namedsomething; [tabbargroceryadsicon setfinishedselectedimage:[uiimage imagenamed:@"namedsomethingselected.png"]   withfinishedunselectedimage:[uiimage imagenamed:@"namedsomethingunselected.png"]]; 

i'm developing ios 6 , using storyboard. appreciated :) cheers, daniel ran

programmaticaly, can set our tabbarbuttons array.

first, set buttons :

uitabbaritem *mybutton1 = [[uitabbaritem alloc] initwithtitle:@"title" image:[uiimage imagenamed:@"image.png"] tag:i] 

then, init nsarray buttons :

nsarray *myarray = [[nsarray alloc] initwithobjects:mybutton1,mybutton2,..., nil] 

finally, set tabbar items :

[mytabbar setitems:myarray]; 

Comments

Popular posts from this blog

Change php variable from jquery value using ajax (same page) -

Pull out data related to my apps from Android Play Store and iOS App Store -

How can I fetch data from a web server in an android application? -