删除IOS7中导航栏上的左键之前的空格? [英] Remove space before left button on Navigation bar in IOS7?

查看:60
本文介绍了删除IOS7中导航栏上的左键之前的空格?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我可以实现导航栏并添加左栏按钮,但是在左按钮有空间之前,请询问如何在ios 7中删除该空间.

I can implement navigation bar and add left bar button, but before left button have space, please ask how to remove this space in ios 7.

推荐答案

使用它,我已经使用过,并且在iOS 7上也能正常工作

use this it will work i have used it and works fine on iOS 7 also

UIBarButtonItem *homeButton = [[UIBarButtonItem alloc] initWithCustomView:segmentView];
UIBarButtonItem *negativeSpacer = [[UIBarButtonItem alloc]
                                   initWithBarButtonSystemItem:UIBarButtonSystemItemFixedSpace
                                   target:nil action:nil];
   negativeSpacer.width = -6;// it was -6 in iOS 6  you can set this as per your preference
[self.navigationItem setLeftBarButtonItems:[NSArray arrayWithObjects:negativeSpacer,homeButton, nil] animated:NO];

这篇关于删除IOS7中导航栏上的左键之前的空格?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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