Ios UINavigationBar中的两个按钮未对齐

Ios UINavigationBar中的两个按钮未对齐,ios,uinavigationbar,uibarbuttonitem,Ios,Uinavigationbar,Uibarbuttonitem,我在viewdiload中有以下代码以在UINavigationBar的右侧添加两个按钮——我省略了左侧“取消”按钮的代码 效果很好,但看起来不太好,“+”符号似乎比“完成”这个词大,而且它们看起来彼此偏离中心: 有没有办法让它看起来更漂亮?您使用的是默认的SystemItem,我相信这正是它们应该看起来的样子。苹果肯定已经调整了布局,所以实际上没有必要修改位置 我的建议是保留它,不要做任何事 但是,如果您真的想更改默认位置,这里有许多解决方案:我想知道这是否与我使用不同字体(Avenir)作

我在
viewdiload
中有以下代码以在
UINavigationBar的右侧添加两个按钮
——我省略了左侧“取消”按钮的代码

效果很好,但看起来不太好,“+”符号似乎比“完成”这个词大,而且它们看起来彼此偏离中心:


有没有办法让它看起来更漂亮?

您使用的是默认的SystemItem,我相信这正是它们应该看起来的样子。苹果肯定已经调整了布局,所以实际上没有必要修改位置

我的建议是保留它,不要做任何事


但是,如果您真的想更改默认位置,这里有许多解决方案:

我想知道这是否与我使用不同字体(Avenir)作为标题有关。加号的尺寸可能针对标准系统字体进行了优化。我将在今天晚些时候对此进行调查。
    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;