gpt4 book ai didi

ios - 如何编辑 UINavigationBar 中左、右 UIBarButtonItem 的空白区域 [iOS 7]

转载 作者:IT王子 更新时间:2023-10-29 07:30:57 24 4
gpt4 key购买 nike

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

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com