iphone facebook 应用程序如何修复导航栏

how iphone facebook app make the navigation bar fixed(iphone facebook 应用程序如何修复导航栏)
本文介绍了iphone facebook 应用程序如何修复导航栏的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是 iPhone 开发的新手,想询问有关导航控制器的问题.如何使导航控制器固定在整个应用程序上,例如 facebook 导航栏.它始终在导航栏中显示通知、好友和消息.

I'm new in iPhone development and want to ask about the navigation controller. How can I make the navigation controller fixed over the whole application, like the facebook navigation bar. It always shows the notification, friends and messages in the navigation bar.

我正在尝试将自定义视图放在 titleView 中,但每次导航推送新视图时它都会消失?

I'm trying to put custom view in the titleView but it disappears every time the navigation push new view?

推荐答案

这对我有用:

toolBar = [[UIView alloc]initWithFrame:CGRectMake(105, 20, 105, 44)];
notificationsBtn = [UIButton buttonWithType:UIButtonTypeCustom];
messagesBtn = [UIButton buttonWithType:UIButtonTypeCustom];

[notificationsBtn setImage:[UIImage imageNamed:@"notifications-icon.png"] forState:UIControlStateNormal];
[notificationsBtn setFrame:CGRectMake(35, 0, 35 , 44)];
[notificationsBtn addTarget:self action:@selector(showNotifications:) forControlEvents:UIControlEventTouchUpInside];

[messagesBtn setImage:[UIImage imageNamed:@"messages-icon.png"] forState:UIControlStateNormal];
[messagesBtn setFrame:CGRectMake(70, 0, 35 , 44)];
[messagesBtn addTarget:self action:@selector(showMessages:) forControlEvents:UIControlEventTouchUpInside];

[toolBar addSubview:notificationsBtn];
[toolBar addSubview:messagesBtn];

[_window.rootViewController.view addSubview:toolBar];

这篇关于iphone facebook 应用程序如何修复导航栏的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!

本站部分内容来源互联网,如果有图片或者内容侵犯您的权益请联系我们删除!

相关文档推荐

Pushing UIViewController above UITabBar(将UIView控制器推送到UITabBar上方)
java.lang.IllegalStateException: SimpleTypeImpl should not be created for error type(异常:不应为错误类型创建SimpleTypeImpl)
Android IllegalArgumentException: The tag for fragment_XXX is invalid. Received: layout-sw600dp/fragment_XXX_0(Android IlLegalArgumentException:Fragment_XXX的标签无效。收到:Layout-sw600dp/Fragment_XXX_0)
iOS convert audio sample rate from 16 kHz to 8 kHz(IOS将音频采样率从16 kHz转换为8 kHz)
Enforcing an audio sampling rate in iOS(在iOS中强制音频采样率)
HTTPS request using volley(使用 volley 的 HTTPS 请求)