override func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell { let cellIdentifier = "cellIdentifie...
分类:
其他好文 时间:
2015-09-17 09:58:16
阅读次数:
129
选中tableView的indexPath.row这一行- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { if (self.isFromChatView) se....
分类:
移动开发 时间:
2015-09-15 12:45:15
阅读次数:
179
采用存取indexPath的方式,来对多个选中的单元格进行删除删除前: 删除后: 分析:如何实现删除多个单元格呢?这需要用到UITableView的代理方法,即选中单元格时对单元格做的处理,同时我们也要定义一个可变的数组,用来存储选中的数据,以便...
分类:
移动开发 时间:
2015-09-08 20:11:28
阅读次数:
158
当面向字典开发或服务器返回的数据为字典时,应当判断字典内是否有对应的key值,从而避免返回key值为空而导致程序奔溃:NSDictionary *dict = self.datas[indexPath.row];if([[dict allKeys] containsObject:@"key"]){ ...
分类:
移动开发 时间:
2015-09-06 21:21:26
阅读次数:
158
------------------------表UITableView------------------------获取index path根据cell具体位置(行数或者区数)获取index pathNSIndexPath*indexpath = [NSIndexPathindexPathFor...
分类:
其他好文 时间:
2015-09-02 00:09:34
阅读次数:
239
最近在使用MJRefresh框架时发现了一个bug下面是我的源代码前一个界面-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{ // 显示网页 CH...
分类:
其他好文 时间:
2015-08-30 14:09:17
阅读次数:
107
在写项目时候,tableView的分割线一般都会自定义,我采取的方法是为UITableView额外的添加一个叫1 - (BOOL)tableView:(UITableView *)tableView borderForRowAtIndexPath:(NSIndexPath *)indexPath;的...
分类:
其他好文 时间:
2015-08-28 17:25:32
阅读次数:
120
UITableViewCell *cell = [tableView cellForRowAtIndexPath:indexPath];
cell.selected = NO;
[self.tableView deselectRowAtIndexPath:indexPath animated:YES];...
分类:
其他好文 时间:
2015-08-27 23:13:19
阅读次数:
211
- (UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath
*)indexPath
测试始终不走这个代理方法的原因肯定是因为UICollectionViewFlowLayout *layout = [[[UICollectionV...
分类:
其他好文 时间:
2015-08-25 21:50:12
阅读次数:
187
//设置行高
- (CGFloat)tableView:(UITableView )tableView heightForRowAtIndexPath:(NSIndexPath )indexPath{return 80;
}
//分区
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
{
// Ret...
分类:
其他好文 时间:
2015-08-21 15:37:52
阅读次数:
87