UIToolbar UIBarButtonItem Alignment question
Posted
by Luther Baker
on Stack Overflow
See other posts from Stack Overflow
or by Luther Baker
Published on 2010-05-02T18:39:01Z
Indexed on
2010/05/02
18:48 UTC
Read the original article
Hit count: 605
uitoolbar
|uibarbuttonitem
I need to create a UIToolbar that has two UIBarButtonItems. The 1st button must be centered and the 2nd item must be right aligned.
I understand and use Flexible spacing and it works great when I need to balance buttons across the UIToolbar, but with only two buttons, I can't seem to perfectly center the middle button. I've even initialized the view.toolbarItems array with
NSArray *items = [[NSArray alloc] initWithObjects:fixed, flex, center_button, flex, right_button, nil];
and set fixed.width = right_button.width ... but still, the center_button is never perfectly centered.
© Stack Overflow or respective owner