隐藏导航栏标题 [英] hiding title of navigationbar

查看:70
本文介绍了隐藏导航栏标题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的第一个视图称为后退".我需要隐藏导航栏的标题,因为我有自定义的导航栏.

my first view named "back". I need to hidden the title of the navigationbar because I have my custom navigation bar.

我尝试使用此代码,但是没有用!

I try with this code but it didn't work!

self.title = @"back";
self.navigationController.navigationItem.titleView.hidden = YES;

推荐答案

正面临着同样的问题,并且这样做:

Just faced the same issue, and doing:

self.title = @"YourTitle";
self.navigationItem.titleView = [[UIView alloc] init];

成功了.下一个视图将带有标有 YourTitle 的后退按钮,但是在第一个视图中,标题将不会显示.

Did the trick. The next view will have the back button labeled with YourTitle but in the first one, the title won't be shown.

这篇关于隐藏导航栏标题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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