创建UITableViewController子类的实例后,IDE生成的代码中有如下段落:- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { ...
分类:
其他好文 时间:
2014-11-28 11:46:28
阅读次数:
131
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{ // 自定义cell点击背景 cell.selectedBackgroundView =.....
分类:
其他好文 时间:
2014-11-27 18:07:28
阅读次数:
126
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{ // 自定义cell点击背景 cell.selectedBackgroundView ...
分类:
其他好文 时间:
2014-11-27 17:47:45
阅读次数:
119
有没有遇到过,导航+UITableView,在push,back回来之后,当前cell仍然是选中的状态。当然,解决办法简单,添加一句[tableView deselectRowAtIndexPath:indexPath animated:YES]即可。令人纠结的时,在没加这句的时候,有的视图同样回来...
分类:
其他好文 时间:
2014-11-25 22:50:42
阅读次数:
126
1.在加载cell的地方(即 (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath
*)indexPath里面)加上下面几句代码
[cell setBackgroundColor:CLEARCOLOR];
cell.se...
分类:
其他好文 时间:
2014-11-21 10:41:57
阅读次数:
220
常规配置如下 当超过tableView显示的范围的时候 后面显示的内容将会和前面重复
// 这样配置的话超过页面显示的内容会重复出现
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
// 定义唯一标识
static NS...
分类:
移动开发 时间:
2014-11-18 10:24:08
阅读次数:
510
这个意思是,__NSDictionaryM 无法将值传到下标索引对象,言简意赅就是数组越界,但是再看看,这是数组吗?不是,所以,遇到这种crash,我这里有两种情况:
1.首先看看你 indexPath.row 用的有没有问题;
2.看看你请求下来的数据类型对不对。
如果还有其他情况,欢迎留言
有的时候,系统并不提示你crash在了哪里,仅仅返回到了main函数,这个时候,点击 ...
分类:
移动开发 时间:
2014-11-17 17:49:26
阅读次数:
290
使用空白view取代cell- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{ //取消选中颜色 UIView *backView = [[.....
分类:
其他好文 时间:
2014-11-10 17:01:32
阅读次数:
209
今天碰到一个问题,在tableView调试的时候,在数据源方法:- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath这里面的断点始终...
分类:
其他好文 时间:
2014-11-01 23:01:38
阅读次数:
196
在UITableView里面,选择了某一个cell以后,点击立刻取消该cell的选中状态,可以使用如下方法:- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{ //s...
分类:
其他好文 时间:
2014-10-26 11:32:06
阅读次数:
186