Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to add more than one UIBarButtonItem to rightBarButtonItem in ios7?
    primarykey
    data
    text
    <p>I have an existing code which was working fine in ios6. but in ios7 left most item("refresh button") is not showing align to other two UIBarButtonItem . its showing little down. here is the code for iOS6. what changes do i need to make this working in iOS7.</p> <pre><code> // create an array for the buttons NSMutableArray* buttons = [[NSMutableArray alloc] initWithCapacity:3]; // create a standard save button UIBarButtonItem* refreshButton = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemRefresh target:self action:@selector(refreshButtonClicked:)]; refreshButton.style=UIBarButtonItemStyleBordered; //self.navigationItem.rightBarButtonItem = refreshButton; [buttons addObject:refreshButton]; [refreshButton release]; // create a spacer between the buttons UIBarButtonItem *spacer = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemFixedSpace target:nil action:nil]; [buttons addObject:spacer]; [spacer release]; // create a standard delete button with the trash icon UIButton *button = [UIButton buttonWithType:UIButtonTypeInfoDark]; [button setFrame:CGRectMake(0, 0, 30, 30)]; [button addTarget:self action:@selector(InfoButtonTapped:) forControlEvents:UIControlEventTouchUpInside]; infoItem = [[UIBarButtonItem alloc] initWithCustomView:button]; [buttons addObject:infoItem]; // put the buttons in the toolbar and release them [toolbar setItems:buttons animated:NO]; [buttons release]; // place the toolbar into the navigation bar self.navigationItem.rightBarButtonItem = [[[UIBarButtonItem alloc] initWithCustomView:toolbar]autorelease]; </code></pre> <p>Thanks</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload