如何删除iOS 7的后退箭头导航栏? [英] How to remove the back arrow ios 7 navigation bar?

查看:55
本文介绍了如何删除iOS 7的后退箭头导航栏?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的自定义导航栏中,我想使用隐藏默认后退"按钮并使用我的自定义左按钮,但是即使后退"按钮被隐藏,它也会在导航栏的左端占用一些空间.

In my custom navigation bar, i want to use hide default back button and use my customize left button, but even if the back button is hidden, it sill take some space at the left end of navigation bar.

如何完全摆脱后退箭头按钮?我试图设置 backBarButtonItem 和' NavNavigationItem`的'hidesBackButton 属性,但是这些都不起作用.

How to get rid of back arrow button completely? I have tried to set backBarButtonItem and 'hidesBackButtonproperties ofUINavigationItem`, but none of these works.

已更新:

- (void) viewDidLoad{
//...
self.navigationItem.hidesBackButton = YES;
self.navigationItem.leftBarButtonItem = [[UIBarButtonItem alloc] initWithCustomView:_backButtonView];
//...
}

我使用Spark Inspector检查视图层次结构.

I use Spark Inspector to inspect the view hierarchy.

如您所见,后退箭头按钮仍在导航栏中占据一些空间.

As you see, the back arrow button still takes some space in navigation bar.

已更新:

后退箭头实际上是_UINavigationBarBackIndicatorView的一个实例,它看起来像一个私有类.

The back arrow is actually an instance of _UINavigationBarBackIndicatorView, it look like a private class.

已更新:

事实证明,该问题与 UINavigationbarBackIndicatorView 无关.iOS 7将在左侧项目之前添加空格.

It turns out the problem have nothing to do with the UINavigationbarBackIndicatorView. iOS 7 will add spacing before the left item.

此问题类似于.找到了答案.

this problem is similar to this. Found the answer.

推荐答案

事实证明,我的问题类似于

It turns out my problem is similar to this

该问题的解决方案对我有用.

The solution from that question work for me.

这篇关于如何删除iOS 7的后退箭头导航栏?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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