Discussion Forums  >  Status Bar, Navigation Bar

Replies: 6    Views: 164

Antonios
Apple Fan
Profile
Posts: 381
Reg: Feb 12, 2013
Korinthos, Gree...
4,610
06/11/13 04:08 PM (7 years ago)

Add an image as the right button

How can I add an image as the right button instead of the classic ones? I know I should go at the BT_viewUtilities.m and change some code to any of the standard buttons code. But I can't figure out the right code for this...

thanks in advance!
 
SmugWimp
Smugger than thou...
Profile
Posts: 6316
Reg: Nov 07, 2012
Tamuning, GU
81,410
like
06/11/13 07:20 PM (7 years ago)
This 'Might' work out for you...

In your plugin screen where you want the button image, choose an action that you don't want...

In this example, we're going to get rid of our 'fast forward' right button choice...

So, in your plugin control panel, choose right nav button type of 'fast forward', and the screen you want it to transition to, and all that...

Then, in BT_viewUtilities.m go to line 376 or so... It will have a Looooong line that says:

if([rightButtonType isEqualToString:@"fastForward"]) theBarButtonItem = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemFastForward target:theViewController action:@selector(navRightTap) ];

and replace it with this:

if([rightButtonType isEqualToString:@"fastForward"]) theBarButtonItem = [[UIBarButtonItem alloc] initWithImage:[UIImage imageNamed:@"yourProperlyAddedImage.png"] style:UIBarButtonItemStylePlain target:theViewController action:@selector(navRightTap)];

You won't be able to use Fast Forward as 'fast forward' anymore, but if that's a problem you can easily substitute one of the other commands... this one was easy because it's at the bottom...

Cheers!

-- Smug
 
Antonios
Apple Fan
Profile
Posts: 381
Reg: Feb 12, 2013
Korinthos, Gree...
4,610
like
06/11/13 11:54 PM (7 years ago)
thank you so much Smug...You are great!!! that's exactly what I needed...can't wait to get back home to test it out. :)

Although I have to find out how should I do the first step: " So, in your plugin control panel, choose right nav button type of 'fast forward', and the screen you want it to transition to, and all that... "

THANK YOU
 
SmugWimp
Smugger than thou...
Profile
Posts: 6316
Reg: Nov 07, 2012
Tamuning, GU
81,410
like
06/12/13 12:57 AM (7 years ago)
In your plugin screen control panel, there is almost always a way to assign the right nav button... and there is a drop down box of choices... 'fast forward' is one of those choices...

You'll know it when you see it.

Cheers!

-- Smug
 
Antonios
Apple Fan
Profile
Posts: 381
Reg: Feb 12, 2013
Korinthos, Gree...
4,610
like
06/12/13 04:28 AM (7 years ago)
Oh right...you said plugin CONTROL PANEL... I thought I should cahnge something at plugin's code!!!!!!!

Stupid thought from me...I didn't read your post well...THANK YOU!!!!!!

:)
 
SmugWimp
Smugger than thou...
Profile
Posts: 6316
Reg: Nov 07, 2012
Tamuning, GU
81,410
like
06/12/13 05:40 AM (7 years ago)
No problem. I hardly read my posts at all ;)

Hope it works out well for you. Let me know if you have issues.

Cheers!

-- Smug
 
Vicentin
Lost but trying
Profile
Posts: 85
Reg: Nov 22, 2013
Orihuela
2,050
like
12/15/13 06:28 PM (6 years ago)
Again I need to say thanks to SmugWimp
 

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.