ios - Two buttons in UINavigationBar not aligned -
i have following code in viewdidload
add 2 buttons on right of uinavigationbar
- omitted code of left "cancel" button.
uibarbuttonitem *donebuttonitem = [[uibarbuttonitem alloc] initwithbarbuttonsystemitem: uibarbuttonsystemitemdone target: self action: @selector(done:)]; uibarbuttonitem *addbutton = [[uibarbuttonitem alloc] initwithbarbuttonsystemitem: uibarbuttonsystemitemadd target: self action: @selector(add:)]; nsarray* buttons = @[addbutton, donebuttonitem]; self.navigationitem.rightbarbuttonitems = buttons;
works great, doesn't good, "+" symbol seems bigger word "done" , appear off center of each other:
is there way make nicer?
you using default systemitem, , believe it's how should like. apple had tuned layout, it's unnecessary modify position.
my suggestion just keep it, don't anything.
however, if want change default position, here many solutions: change position of uibarbuttonitem in uinavigationbar
Comments
Post a Comment