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 demonstration
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
Post a Comment