Reputation: 301
I have added a tool bar and I am adding a button to that toolbar. That button is automatically aligned to left irrespective to the frame that i set to that button. I want that button to be center of the tool bar. How to make that?
Upvotes: 0
Views: 1324
Reputation: 2022
along with the button, add a flexible space item on the right and on the left sides of the button
Upvotes: 0
Reputation: 40201
Add a flexible space to your tabbar to the left (and right) of your button.
UIBarButtonItem *flexible = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemFlexibleSpace
target:nil action:nil];
Upvotes: 2