Slide UIBarButtonItem

Discussion in 'iPhone/iPad Programming' started by IDMah, Feb 22, 2012.

  1. macrumors regular

    #1
    Hi I've got a right button ala:

    Code:
    -(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
     
  2. macrumors newbie

    OverByThere

    #2
    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?
     
  3. macrumors regular

    #3
    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
     
  4. macrumors 65816

    jnoxx

    #4
    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.
     

Share This Page