我之前使用的是 iOS 6.1,但现在我已经转移到 iOS 7。除了其他问题,我还观察到在我的导航栏中,左侧栏按钮项的左侧空间和右侧按钮栏的右侧空白区域项目在 IOS 7 中比在 iOS 6 中多得多。
我想知道有什么方法可以减少导航栏中左右栏按钮项的空白区域吗??
提前致谢。
最佳答案
我也遇到了这个问题。我也觉得在 iOS 7 中有更多的空间。我发现这大约多了 10 分。当我希望 LeftBarItemButton
从边缘开始时,我通常使用负空格。这对您也很有用。
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];
关于ios - 如何编辑 UINavigationBar 中左、右 UIBarButtonItem 的空白区域 [iOS 7],我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18914812/