一、UITableView的属性NSIndexPath类型是用来获取用户选择的indexPath,在别的函数里面,若需要知道用户选择了哪个cell,用上它可以省事很多。不必再去建全局变量section和row。NSIndexPath *tableSelection = [self.tableView...
分类:
其他好文 时间:
2014-12-11 10:02:16
阅读次数:
202
当 UITableView 中有一个 label 的内容比较长的时候,就需要 cell 自适应高度来多行展示label;首先设置 label 的 line 为0;代码如下:// 为每一个 cell 预设置一个高度,可以提高效率- (CGFloat)tableView:(UITableView *)...
分类:
移动开发 时间:
2014-12-10 22:35:18
阅读次数:
218
UITableView的详细使用 UITableView是app开发中常用到的控件,功能很强大,多用于数据的显示。下面以一个简单的实例来介绍tableview的基本用法。(适合新手,高手飘过)@interfaceTableViewTestViewController :UIViewControll....
分类:
其他好文 时间:
2014-12-10 21:02:27
阅读次数:
379
多选做法如下:
- (void)tableView:(UITableView *)tableViewdidSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
[tableViewdeselectRowAtIndexPath:indexPath animated:YES];
Custom *cell= (Custom*...
分类:
移动开发 时间:
2014-12-10 16:17:13
阅读次数:
216
当切换tableView.separatorStyle时,需要注意tableView.tabHeaderView假如,切换的同时要改变tableView.tabHeaderView为nil,那么在代码上要注意,先切换,然后再tableView.tabHeaderView=nil;否则会导致crash...
分类:
移动开发 时间:
2014-12-10 12:29:21
阅读次数:
160
问题背景:
需要在UITableView中的每一行下载图片,之前使用placeholder,下载好后存在cache中。
解决方案:
方案一:
使用SDWebImage:https://github.com/rs/SDWebImage
如何安装及使用在git页面有详细解释,具体使用的代码:
#import
...
- (UITableViewCell *)tableView...
分类:
移动开发 时间:
2014-12-10 00:34:03
阅读次数:
292
ISO TableView 多选删除,方便做项目用...
分类:
其他好文 时间:
2014-12-09 21:38:31
阅读次数:
187
今天为做一个小小的footerView我的心脏差点气出来。。。第一步 新建一个view xib文件第二步 新建一个UIview的类第三步 在UIview中间放一个Lable,添加约束,水平垂直居中第四步 实例化UIView然后赋值给tableView的footerView然后问题就来了,我发现在竖屏...
分类:
移动开发 时间:
2014-12-09 19:32:46
阅读次数:
134
// 默认选中第一行只执行一次(否则有BUG) if (!isRuned) { NSIndexPath *firstPath = [NSIndexPathindexPathForRow:0inSection:0]; [m_tableViewselectRowAtIndexPath:fi...
分类:
其他好文 时间:
2014-12-09 17:28:53
阅读次数:
209
//1.设置可以编辑- (BOOL)tableView:(UITableView *)tableView canEditRowAtIndexPath:(NSIndexPath *)indexPath{ return YES;}- (UITableViewCellEditingStyle)tableV...
分类:
其他好文 时间:
2014-12-08 21:17:25
阅读次数:
136