Friday, September 24, 2010

How to right or center align the UIToolBar items

create  buttons like this 
UIBarButtonItem *flexibleSpace = [[UIBarButtonItem alloc] 
              initWithBarButtonSystemItem:UIBarButtonSystemItemFlexibleSpace 
              target:nil action:nil];


Add  UIBarButtonSystemItemFlexibleSpace items to your toolbar, to the left and right of your items OR left to get the center align OR right align

3 comments:

  1. Thanks. I wanted to right align a button on a toolbar at the bottom of a view and all I had to do was drop a "Flexiable Space Bar Button Item" on the toolbar and right automatically right aligned my button.

    ReplyDelete