导航栏添加子标题
来源:互联网 发布:广州本科网络教育 编辑:程序博客网 时间:2024/06/07 06:31
//声明两个label
@property(nonatomic,strong)UILabel *naTitle;
@property(nonatomic,strong)UILabel *naSubTitle;
- (void)creatNav{
UIView *la = [[UIViewalloc]init];
la.frame =CGRectMake(0,20, [UIScreenmainScreen].bounds.size.width,44);
self.naTitle = [[UILabelalloc]init];
self.naTitle.frame =CGRectMake(150/2,2, [UIScreenmainScreen].bounds.size.width-150.0f,23.0f);
self.naTitle.textColor =[UIColorwhiteColor];
self.naTitle.textAlignment = NSTextAlignmentCenter;
self.naTitle.font = [UIFont systemFontOfSize:20];
// navTitleL.backgroundColor =[UIColor redColor];
[la addSubview:self.naTitle];
self.naSubTitle = [[UILabelalloc]init];
self.naSubTitle.frame =CGRectMake(150/2,23,[UIScreenmainScreen].bounds.size.width-150.0f,17.0f);
self.naSubTitle.textColor =[UIColorwhiteColor];
self.naSubTitle.textAlignment = NSTextAlignmentCenter;
self.naSubTitle.font =[UIFont systemFontOfSize:14];
[la addSubview: self.naSubTitle];
//视图替换
self.navigationItem.titleView = la;
self.naSubTitle.text =@"主标题";
self.naTitle.text =@"副标题";
self.naSubTitle.textColor=[UIColorblackColor];
self.naTitle.textColor =[UIColorredColor];
}
调用;
[selfcreatNav];
- 导航栏添加子标题
- 在 iPhone 应用的导航栏添加自定义标题
- 更改导航栏标题
- 导航栏标题颜色
- 导航栏标题
- iPhone 导航栏标题颜色
- 导航栏标题知多少
- 导航栏标题颜色设置
- 自定义导航栏按钮 标题
- 更改导航栏的标题
- 导航栏标题不居中
- Android 滑动标题导航栏
- 设置导航栏标题颜色
- android自定义导航、可滚动(添加子导航、栏目)
- 使用jquery动态添加导航页卡和标题
- 自定义添加导航栏
- ViewPager添加导航栏
- 导航栏添加按钮
- 排名Top 16的Java实用类库
- Ajax等待界面美化和div永远屏幕居中显示
- 增加Tomcat连接数
- jar包、可执行jar包、classpath
- linux磁盘管理
- 导航栏添加子标题
- Android科大讯飞语音合成
- 函数及变量跨模块调用
- pygame.error: Unable to open file 'pickup.wav'
- 2017 谷歌 I/O大会
- NB算法
- 禁调滑动的recyclerview
- [知识汇总] Qt、Qt SDK以及Qt Creator的区别
- vue如何在sublime text 中变成彩色