系统导航栏部分简单研究
来源:互联网 发布:数据统计分析书籍 编辑:程序博客网 时间:2024/05/07 04:06
在研究一下导航栏的时候,想要只用系统的动画,因而发现了一些问题
无法使用系统返回手势
添加delegate
__weak typeof (self) weakSelf =self;
if ([selfrespondsToSelector:@selector(interactivePopGestureRecognizer)]) {
self.interactivePopGestureRecognizer.delegate = weakSelf;
}
-(void)pushViewController:(UIViewController *)viewController animated:(BOOL)animated
{
if ([selfrespondsToSelector:@selector(interactivePopGestureRecognizer)]) {
self.interactivePopGestureRecognizer.enabled = animated;
}
[superpushViewController:viewControlleranimated:animated];
}
导航栏添加照片:
[self.navigationBarsetBackgroundImage:[UIImageimageNamed:@"big4ads_banner02.png"]forBarMetrics:UIBarMetricsDefault];
一些ViewController手势冲突,添加delegate
self.navigationController.delegate=self;
- (void)navigationController:(UINavigationController *)navigationController
didShowViewController:(UIViewController *)viewController
animated:(BOOL)animated
{
if ([viewControllerisKindOfClass:self.class]) {
navigationController.interactivePopGestureRecognizer.enabled =NO;
}elseif ([navigationController respondsToSelector:@selector(interactivePopGestureRecognizer)]) {
navigationController.interactivePopGestureRecognizer.enabled =YES;
}
}
iOS 7以上系统修改title文字大小,颜色
[[UINavigationBarappearance] setTitleTextAttributes:[NSDictionarydictionaryWithObjectsAndKeys:[UIColorblackColor], NSForegroundColorAttributeName, [UIFontfontWithName:@ "HelveticaNeue-CondensedBlack"size:18.0],NSFontAttributeName, nil]];
导航栏UIBarButtonItem的修改
UIButton *clearButton = [[UIButtonalloc] initWithFrame:CGRectMake(0,0, 44,44)];
clearButton.tintColor =[UIColorblackColor];
UIImage *image =[UIImageimageNamed:@"delete"];
image=[image imageWithRenderingMode:UIImageRenderingModeAlwaysTemplate];
[clearButton setImage:imageforState:UIControlStateNormal];
[clearButton addTarget:selfaction:@selector(removeAllMessages:)forControlEvents:UIControlEventTouchUpInside];
self.navigationItem.rightBarButtonItem = [[UIBarButtonItemalloc] initWithCustomView:clearButton];
[[UIBarButtonItem appearance]setTintColor:[UIColor blackColor]];
上传一张结构图用来研究修改系统返回按钮的修改需要在上一层修改。
self.navigationItem.backBarButtonItem=back;
系统返回按钮title会使用上一层的title,如果title长度过长,会使用系统语言的“返回”。
- 系统导航栏部分简单研究
- 简单导航栏
- 简单导航栏 demo
- 简单web导航栏
- 【css】导航栏小结(一)-----简单导航
- [iOS 自定义导航栏/导航条]隐藏系统导航条
- 导航栏遮盖住部分View的解析
- iOS中设置导航栏部分属性
- 一个简单的导航栏
- 简单的导航栏设计
- 导航栏的简单实现
- 底部导航栏简单版
- Android 隐藏系统导航栏
- 修改系统底部导航栏
- 自定义系统导航栏UINavigationBarController。
- 简单导航
- 系统导航
- 系统导航
- 哈夫曼树及哈夫曼树编码
- cocos2dx中的动画以及TexturePacker使用
- Coding CTO 孙宇聪:《人,技术与流程》
- iOS可执行文件瘦身方法
- 题目:输入一行字符,分别统计出其中英文字母、空格、数字和其它字符的个数。
- 系统导航栏部分简单研究
- 使用马尔可夫模型自动生成文章
- MySQL学习笔记之启动停止与登录,显示相关信息
- ZYgote
- express 框架之session (cookie和session介绍)
- premnmx
- MySQL配置项innodb_flush_log_at_trx_commit
- Ionic 添加ngCordova插件
- __no_init