PDA

View Full Version : Slide UIBarButtonItem




IDMah
Feb 22, 2012, 11:38 AM
Hi I've got a right button ala:

-(id)init
{
//[[self navigationItem] setTitle:[NSString stringWithFormat:@"%@ Cards",[company companyName]]];
UIBarButtonItem *bby = [[UIBarButtonItem alloc]
initWithBarButtonSystemItem:UIBarButtonSystemItemCamera
target:self
action:@selector(switchToQRCodeReader)];

// set this bar button to the right side item in the navigationItem //
[[self navigationItem] setRightBarButtonItem:bby animated:YES];
[bby release];
}


and the same button on another View. the Left button slides in/out ok, but the right button floats. How do I get the RightButton to slide as well?

thanks
Ian



OverByThere
Feb 26, 2012, 06:40 AM
Hi,

I'm not sure what you mean by "floats"?

I would recommend you put this code into -(void)viewDidLoad, and then if possible give us screenshots to further diagnose the issue?

IDMah
Feb 27, 2012, 02:26 AM
I'll try words first.

I have a ListView with [camera icon] and stuffView with [camera icon].
so as the stuffView slides off the [Camera icon] stays on right obscuring the stuffView Label and anything on the left .

What I would like is for the camera icon to slide off with the ListView and a [New Camera Icon] slide on from the right nailed with the stuffView.

I might just live with it, but a solution would be great.

adding it to viewDidLoad did nothing..
thanks
Ian

jnoxx
Feb 27, 2012, 03:51 AM
You are then (by reading your lines), adding the icons to the wrong navigationBar, or you're navigation tree is corrupted (doesn't it say that in the logs?). Because this should be automated, and if it isn't, it's an error on the code of switching etc.