ios - Tabbar buttons order changed after go to other view -


i have 2 buttons in tabbar, programmatically added. order changed after navigating placeholder within view.

when open app:
enter image description here
when go movies tab:
enter image description here

the code:

self.searchbutton = [[uibarbuttonitem alloc] initwithbarbuttonsystemitem:uibarbuttonsystemitemsearch target:self action:@selector(togglesearchbar)];  uiimage* meetupbuttonicon = [uiimage imagenamed:@"meetup_logo_icon"]; uiimage* meetupbuttoniconhighlighted = [uiimage imagenamed:@"meetup_logo_icon_highlighted"]; cgrect frameimg = cgrectmake(0, 0, 25, 25); uibutton *meetupuibutton = [[uibutton alloc] initwithframe:frameimg]; [meetupuibutton setbackgroundimage:meetupbuttonicon forstate:uicontrolstatenormal]; [meetupuibutton setbackgroundimage:meetupbuttoniconhighlighted forstate:uicontrolstatehighlighted]; [meetupuibutton addtarget:self action:@selector(togglemeetup:) forcontrolevents:uicontroleventtouchupinside]; uibarbuttonitem *meetupicon =[[uibarbuttonitem alloc] initwithcustomview:meetupuibutton]; self.meetupbutton = meetupicon;  [self.navigationitem setrightbarbuttonitems:[nsarray arraywithobjects:_meetupbutton, _searchbutton, nil]]; 

the strange thing need add buttons in wrong order in array: _meetupbutton, _searchbutton , looks change right order. question how force images in same order.

something maybe goes wrong. working, leftbarbuttonitems of navigationitem can ordered sequence of array assign , rightbarbuttonitems of navigationitem can ordered inverted sequence of array assign.

maybe can give try!


Comments

Popular posts from this blog

php - Wordpress website dashboard page or post editor content is not showing but front end data is showing properly -

javascript - Get parameter of GET request -

javascript - Twitter Bootstrap - how to add some more margin between tooltip popup and element -