iOS导航栏的设置
来源:互联网 发布:常见20网络诈骗 编辑:程序博客网 时间:2024/06/01 07:43
在开发过程中,很多时候给导航栏设置一个title不能满足项目的需求,有时候我们还要给这个title添加相应的图片,具体做法如下。
//创建一个Base视图 UIView *titleBaseView = [[UIView alloc] initWithFrame:CGRectMake((WIDTH_VIEW - 70)/2, 11, 70, 22)]; //titleBaseView.backgroundColor = [UIColor redColor]; //创建一个ImageView UIImageView *titleImageView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"倒计时"]]; //创建一个Label UILabel *titleLabel = [[UILabel alloc] initWithFrame:CGRectMake(22, 0, 70 - 22, 22)]; titleLabel.font = [UIFont systemFontOfSize:18.0]; titleLabel.textColor = TITLE_COLOR_DEEP; titleLabel.textAlignment = NSTextAlignmentCenter; titleLabel.text = @"时间"; //将两个控件添加到Base视图上 [titleBaseView addSubview:titleImageView]; [titleImageView addSubview:titleLabel]; //将Base视图设置为导航栏标题视图 self.navigationItem.titleView = titleBaseView;
0 0
- iOS导航栏的设置
- ios 导航栏设置
- iOS 导航栏设置
- IOS ---设置导航栏
- iOS导航栏设置
- ios导航栏的背景图片设置
- iOS 设置导航栏的主题
- iOS--导航栏属性设置的介绍
- IOS NavigitionController导航栏的基本设置
- iOS导航栏的一些设置
- ios中导航栏的设置
- 设置iOS导航栏透明
- ios设置导航栏属性
- IOS 导航栏属性设置
- ios 导航栏状态栏设置
- iOS 导航栏颜色设置
- iOS -- 导航栏和标签栏的一些设置
- iOS 设置导航栏返回按钮中箭头的颜色
- 【cqbzoj2500】攻占城堡
- SpringMVC接收Sting[]类型
- 爱摘苹果的小明
- 分布式唯一ID生成器Twitter 的 Snowflake idworker java版本
- 必须要注意的 C++ 动态内存资源管理(五)——智能指针陷阱
- iOS导航栏的设置
- 运行Tomcat出现the JRE_HOME environment variable is not defined correctly 的解决办法--个人经验记录
- scala基本语法及注意点
- iOS 开发 XMPP即时通讯项目开发(仿微信)-详解之openfire服务器失败问题
- Python3的语法学习
- vim的powerline插件没有颜色
- 2016个推详细配置详解
- Python-strip(),lstrip(),rstrip()
- 多线程下载