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