iOS 自定义Navigation
来源:互联网 发布:淘宝预售订单怎么取消 编辑:程序博客网 时间:2024/05/22 16:42
本人刚学习iOS个人笔记不喜请勿喷
//设置navigationController的背景颜色
[self.navigationController.navigationBarsetBarTintColor:[UIColororangeColor]];
//自定义一个view为title(image)的载体
UIImageView *imageView = [[UIImageViewalloc] initWithImage:[UIImageimageNamed:@"吉"]];
//将自定义title(image)的载体添加到navigationItem上
self.navigationItem.titleView = imageView;
//设置文字
// UILabel *textView1=[[UILabel alloc]initWithFrame:CGRectMake(0, 0, self.navigationController.navigationBar.frame.size.width, self.navigationController.navigationBar.frame.size.height)];
// textView1.backgroundColor=[UIColor blackColor];
// textView1.text = @"首页";
// textView1.textColor = [UIColor whiteColor];
// [self.navigationItem setTitleView:textView1];
// 自定义一个button
UIButton *LeftBtn = [[UIButtonalloc]init];
LeftBtn.frame = CGRectMake(0,0, self.navigationController.navigationBar.frame.size.height,self.navigationController.navigationBar.frame.size.height);
LeftBtn.backgroundColor = [UIColor blueColor];
// 将自定义的button添加到系统的UIBarButtonItem上
UIBarButtonItem *LeftBarBtn = [[UIBarButtonItemalloc]initWithCustomView:LeftBtn];
//将系统的UIBarButtonItem 添加到navigationItem的左侧
self.navigationItem.leftBarButtonItem = LeftBarBtn;
UIButton *RightBtn = [[UIButtonalloc]init];
RightBtn.frame = CGRectMake(0,0, self.navigationController.navigationBar.frame.size.height,self.navigationController.navigationBar.frame.size.height);
RightBtn.backgroundColor = [UIColor blueColor];
UIBarButtonItem *RightBarBtn = [[UIBarButtonItemalloc]initWithCustomView:RightBtn];
//将系统的UIBarButtonItem 添加到navigationItem的右侧
self.navigationItem.rightBarButtonItem = RightBarBtn;
- iOS: 自定义navigation bar
- iOS 自定义Navigation
- IOS-自定义Tabbar与Navigation
- ios自定义导航navigation,设置navigation的背景图,navigation左边按钮,以及navigation字体颜色
- iOS-自定义Navigation左侧的leftBarButtonItem
- 自定义Navigation
- 自定义navigation
- Navigation自定义
- IOS-Navigation
- iOS navigation bar title 换成自定义的图片 swift 版
- navigation自定义barbuttonitem
- navigation自定义title
- 自定义Navigation转场动画
- Navigation返回按钮自定义
- IOS Navigation总结
- IOS Navigation总结
- IOS之Navigation Bar
- IOS Navigation总结
- MySQL物理文件组成
- epoll解读
- php利用百度地图API进行IP定位和GPS定位
- device tree
- 看看一年内都发生了什么变化:Gartner 2016年应用程序平台即服务(aPaaS)魔力象限报告
- iOS 自定义Navigation
- Raptor实践参考:三色球问题
- 配置工具
- 指针作为函数形参
- android studio安装中出现Failed to install Intel HAXM错误的解决方法
- 提高机器学习模型准确率的八大方法
- 将进程的输出重定向至文件中
- 手机常识
- Unity 3D中的内存管理