Discussion Forums  >  Plugins, Customizing, Source Code

Replies: 3    Views: 39

JimmySaver
Aspiring developer
Profile
Posts: 187
Reg: Apr 09, 2012
location unknow...
5,870
09/03/14 02:44 AM (9 years ago)

Two buttons in the NavBar RHS - iOS - A Possibility?

I'm using Kittsy's Add to Favorites plugin and it's performing sterlingly. The "add" symbol appears as and where it should. I'd like to have a second button in the navbar right hand side, however. When I create this second button in the control panel, it doesn't show. Logic would say that it is being called but appear behind the "add" symbol for the Favorites plugin (this is, after all, hardcoded rather than called from the control panel). Is it just a case of moving the location a little to the left to display both of these buttons? Or is something deeper afoot?
 
chris1
Code is Art
Profile
Posts: 3862
Reg: Aug 10, 2012
Austin, TX
50,120
like
09/03/14 06:21 AM (9 years ago)
It's actually different code to add one button to the navbar compared to more than one. For one button, you set it like this: self.navigationItem.leftBarButtonItem = customButton; To set multiple buttons, it looks like this: self.navigationItem.leftBarButtonItems = [[NSArray alloc] initWithObjects:customButton1,customButton2,nil];
 
Kittsy
buzztouch Evangelist
Profile
Posts: 2251
Reg: Feb 22, 2012
Liverpool
31,360
like
09/09/14 02:12 PM (9 years ago)
Sorry for seeing this late I echo what chris says the customButton1 and 2 should be replaced like this self.navigationItem.rightBarButtonItems = [[NSArray alloc] initWithObjects:self.navigationItem.rightBarButtonItem,[[AK_favorites favoritesManager]favoritesAddButton],nil]; What happened was that when the original code was added it replaced buzz touches right nav bar button. The method above adds buzz touches original button first then adds the favourites one
 
JimmySaver
Aspiring developer
Profile
Posts: 187
Reg: Apr 09, 2012
location unknow...
5,870
like
09/10/14 12:01 AM (9 years ago)
I was missing a line in my hatchet job - thanks for this!
 

Login + Screen Name Required to Post

pointerLogin to participate so you can start earning points. Once you're logged in (and have a screen name entered in your profile), you can subscribe to topics, follow users, and start learning how to make apps like the pros.