【IOS学习之常见问题】使用表格(tableView)时,分割线/下划线时,长度不全
2018-01-26 16:46
711 查看
█ 介绍:
● @interface … end 相当于C++中的类的变量和方法声明● @implementation … end 相当于C++中的类的方法的实现
● @interface … end和@implementation … end 合在一起 相当于Java中的类
● protocal就相当于Java中的interface
● OC中.h的格式是:
@interface UserInfo : NSObject { //变量声明 BOOL hMan1; } //变量声明 @property (nonatomic) BOOL hMan2; ...... //方法声明 -(BOOL)ishMan; ...... @end
● OC中.m的格式是:
-(CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath { return 52; }
█ 分割线的问题:
<font size=4 color="red"> 1.@interface ... end中的变量,放在.m和.h中都可以正常</font>
● 代码:
;
● 结果
navigationItem.title = (null)
title = (null)
● 界面标题显示:(即空字符串)
2.只对self.title赋值,则两个都为self.title
● 代码:
self.title = @”view标题”;
● 结果:
navigationItem.title = @”view标题”
title = @”view标题”
● 界面标题显示:view标题(即navigationItem.title)
3.只对self.navigationItem.title赋值,则显示self.navigationItem.title
● 代码:
self.navigationItem.title = @”nav标题”;
● 结果:
navigationItem.title = @”nav标题”;
title = (null)
● 界面标题显示:nav标题(即navigationItem.title)
4.先对self.title赋值,再对self.navigationItem.title 赋值
● 代码:
self.title = @”view标题1”;
self.navigationItem.title = @”nav标题2”;
● 结果:
navigationItem.title = @”view标题1”→@”nav标题2”
title = @”view标题1”→@”view标题1”
● 界面标题显示:”nav标题2”(即navigationItem.title)
5.先对self.navigationItem.title赋值,再对self.title 赋值
● 代码:
self.navigationItem.title = @”nav标题1”;
self.title = @”view标题2”;
● 结果:
navigationItem.title = @”nav标题1”→@”view标题2”
title = (null)→@”view标题2”
● 界面标题显示:”view标题2”(即navigationItem.title)
█ 总结:
● 标题始终显示self.navigationItem.title的值● 当self.navigationItem.title为空 (null)时,则显示空白
● 当self.title的值被修改时,self.navigationItem.title的值也会跟着修改为self.title的值
● 当self.navigationItem.title的值被修改时,self.title的值不变,标题也会跟着修改为self.navigationItem.title的值
█ 相关资料:
● OC .m文件的@interface总结 - CSDN博客● Objective-c中@interface、@implementation、@protocal - CSDN博客
转载请注明出处:
http://blog.csdn.net/ljb568838953/article/details/79153068
相关文章推荐
- iOS学习之分段Table View的使用(Grouped样式表格)
- ios 9 tableview分割线不全的问题
- iOS学习之分段Table View的使用(Grouped样式表格)
- iOS学习之分段Table View的使用(Grouped样式表格)
- iOS学习之分段Table View的使用(Grouped样式表格)
- iOS学习之分段Table View的使用(Grouped样式表格)
- iOS学习之分段Table View的使用(Grouped样式表格)
- iOS 学习之分段Table View的使用(Grouped样式表格)
- iOS学习之分段Table View的使用(Grouped样式表格)
- iOS学习之分段Table View的使用(Grouped样式表格)
- 【iOS开发学习】关于在TableView里添加搜索的问题。
- iOS学习--列表下拉/上拉刷新: (一)EGORefreshTableHeaderView使用、定义EGORefreshTableFooterView
- iOS学习之Table View的简单使用
- IOS 学习笔记 —— tableView 使用详解(二)
- iOS学习之Table View的简单使用
- iOS学习之Table View的简单使用
- iOS 学习笔记 五 (2015.03.17)使用storyBoard进行tableview的跳转
- IOS学习日志---1:TableView下拉刷新以及各种失败问题总结
- iOS学习之Table View的简单使用
- iOS学习之Table View的简单使用