如何在 UINavigationBar [iOS 7] 中编辑左、右 UIBarButtonItem 的空白区域 [英] How to Edit Empty Spaces of Left, Right UIBarButtonItem in UINavigationBar [iOS 7]
问题描述
我之前使用的是iOS 6.1,但现在我已经转移到iOS 7.除了其他问题之外,我发现在我的导航栏中,左侧栏按钮项的左侧空间和右侧按钮栏的右侧空白IOS 7 中的项目比 iOS 6 中的要多得多.
I was using iOS 6.1 earlier, but now I have moved to iOS 7. Along with other problems, I have observed that in my navigation bar, the left space of left bar button item and right empty space of the right button bar item are quite more in IOS 7 than in iOS 6.
我需要知道有没有办法减少导航栏中左右栏按钮项的空白空间??
I need to know is there a way I can reduce empty spaces of left, right bar button items in navigation bar??
提前致谢.
推荐答案
我也遇到了这个问题.我也有感觉,在 iOS 7 中有更多的空间.我发现这大约高出 10 分.当我希望 LeftBarItemButton
从边缘开始时,我通常使用负空格.这对您也很有用.
I was also facing this problem. I also have feelings that in iOS 7 there is more space. And I figured out that this is about 10 points more. I usually use negative spaces when I want for LeftBarItemButton
to start from the edge. This can be useful for you as well.
UIBarButtonItem *negativeSpacer = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemFixedSpace target:nil action:nil];
negativeSpacer.width = -16; // it was -6 in iOS 6
[self.navigationItem setLeftBarButtonItems:@[negativeSpacer, requiredButton]; /* this will be the button which you actually need */] animated:NO];
这篇关于如何在 UINavigationBar [iOS 7] 中编辑左、右 UIBarButtonItem 的空白区域的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!