设置 UINavigationBar 的标题 [英] Setting title of UINavigationBar

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

问题描述

我有一个应用程序,它使用主故事板包含一个导航控制器,其中主视图是使用原型单元格内容的表视图.表格视图中的每个单元格都会推送到我使用它自己的一组 .h .m 和 .xib 文件创建的新视图上.

I have an application which uses a main story board to include a Navigation Controller where the main view is a Table View using a prototype cell content. Each cell in the table view pushes onto a new view which I have created with it's own set of .h .m and .xib files.

表格视图导航栏的标题通过故事板设置,效果很好.但是,在将每个新视图推入视图后,我无法为其设置标题.

The table view navigation bar has its title set through the story board which works fine. However, I am having trouble setting the title for each new view after it gets pushed into view.

我在每个视图的 viewDidLoad 方法中都有以下内容;

I have the following in the viewDidLoad method for each view;

self.title = @"View Title";

有什么建议吗?

推荐答案

这是正确的方法.它会起作用的.

it is the right way. it will work.

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

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