如何在UINavigationBar [iOS 7]中编辑左,右UIBarButtonItem的空格 [英] How to Edit Empty Spaces of Left, Right UIBarButtonItem in UINavigationBar [iOS 7]

查看:142
本文介绍了如何在UINavigationBar [iOS 7]中编辑左,右UIBarButtonItem的空格的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我之前使用的是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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆