动态标题,就像在 Notes 应用程序中一样

发布于 2024-10-08 12:09:48 字数 209 浏览 1 评论 0原文

当用户在 uitextview 中输入文本时,我希望导航栏的标题像在 Notes 应用程序中一样动态更改。

我怎样才能实现这个目标?

我认为使用了标签,不是吗?

谢谢弗兰

编辑

:我知道如何更改导航栏的标题,但是如何以文本视图与标题绑定的方式执行此操作,因此当用户在同一时刻输入第一行文本时,标题会发生变化(字母通过信件)?

when the user enters text in a uitextview I would that the title of the navigation bar changed dynamically like it happens in the Notes app.

How can I achieve this?

I think a label is used, don't I?

Thanks

Fran

EDIT: I know how change the title of a navigation bar, but how do this in a such way that the textview is tied to the title, so while user enters the first line of text in the same moment the title changes (letter by letter)?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

小ぇ时光︴ 2024-10-15 12:09:48
UINavigationItem *navItem;
navItem = [UINavigationItem alloc];
navItem.titleView = lblTitle;
[navBar pushNavigationItem:navItem animated:false];
[navBar setDelegate:self]; 

从以下位置获取此信息: http://www.iphonedevsdk.com/forum/iphone-sdk-development/7015-set-title-uinavigationbar.html iphonedevsdk.com/forum/iphone-sdk-development/7015-set-title-uinavigationbar.html

UINavigationItem *navItem;
navItem = [UINavigationItem alloc];
navItem.titleView = lblTitle;
[navBar pushNavigationItem:navItem animated:false];
[navBar setDelegate:self]; 

Got this info from: http://www.iphonedevsdk.com/forum/iphone-sdk-development/7015-set-title-uinavigationbar.html

吻安 2024-10-15 12:09:48

我知道您可以通过以下方式从子视图控制器中设置导航控制器的标题:

[self setTitle:@"Required title"];

[[self NavigationController] setTitle = @"Required title"];

但是,这些可能无法交互工作。 (不是在 Mac OS X 机器上,否则我会尝试一下。)

I know you can set the title of a navigation controller from within a child view controller simply via:

[self setTitle:@"Required title"];

or

[[self NavigationController] setTitle = @"Required title"];

However, these may not work interactively. (Not at a Mac OS X box otherwise I'd try it out.)

不再让梦枯萎 2024-10-15 12:09:48

我的问题的答案是 此处

The answer to my question is here

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文