uiTableView继承自uiScrollView所以此方法对uiTableView同样有效,测试发现:在uiTableView的偏移量中,scrollView.contentOffset.y是由ScrollView内容视图的高度与UITableView的高度比较而来的,视图向下移动偏移量增加,向...
分类:
其他好文 时间:
2014-08-31 02:46:00
阅读次数:
183
+ (instancetype)cellWithTableView:(UITableView *)tableView{ static NSString *ID = @"Cell"; Cell *cell = [tableView dequeueReusableCellWithIdentifier.....
分类:
其他好文 时间:
2014-08-30 13:46:19
阅读次数:
212
//如果有数据,选中第一行if(tableDataSource.count > 0) { NSIndexPath *indextPath = [NSIndexPath indexPathForRow:0 inSection:0]; // 调用UItableViewD...
分类:
其他好文 时间:
2014-08-29 12:23:57
阅读次数:
116
效果如上。只要补上以下方法://设置多于的分割线-(void)setExtraCellLineHidden: (UITableView *)tableView{ UIView *view = [UIView new]; view.backgroundColor = [UIColor clearC.....
分类:
移动开发 时间:
2014-08-29 10:57:27
阅读次数:
224
影响 UITableView 滚动的流畅性的原因1、 在代理方法中做了过多的计算占用了 UI 线程的时间2、同上3、Cell 中 view 的组织复杂关于第一点,首先要明白 tableview 的代理(这里指 datasource 和 delegate 的那套方法,下同)方法的调用顺序,和时机。对于...
分类:
其他好文 时间:
2014-08-28 22:25:26
阅读次数:
342
- (void)tableView: (UITableView*)tableView willDisplayCell: (UITableViewCell*)cell forRowAtIndexPath: (NSIndexPath*)indexPath{ cell.backgroundColor...
分类:
其他好文 时间:
2014-08-27 10:34:27
阅读次数:
181
1.UITableView加载的顺序是先得到表的行的高度,也就是先调用heightForRowAtIndexPath方法,然后再调用cellForRowAtIndexPath,所以我们有两个办法实现自定义cell高度(解决不同section的不同行高问题)。一:改变它的加载顺序,或者说白了就是计算好...
分类:
其他好文 时间:
2014-08-26 19:19:36
阅读次数:
219
一、本次小例子截图: 二、代码如下:#import @interface Product : NSObject//标题@property (strong, nonatomic) NSString * title;//描述@property (strong, nonatomic) NSString ....
分类:
其他好文 时间:
2014-08-26 19:04:56
阅读次数:
242
下面分9个方面进行介绍:一、UITableView概述 UITableView继承自UIScrollView,可以表现为Plain和Grouped两种风格,分别如下图所示: 其中左边的是Plain风格的,右边的是Grouped风格,这个区别还是很明显的。 查看UITableView的...
分类:
移动开发 时间:
2014-08-26 19:01:16
阅读次数:
298
#pragma mark - UItableView滚动时收键盘- (void)scrollViewWillBeginDragging:(UITableView *)scrollView{ [self.view endEditing:YES];}
分类:
其他好文 时间:
2014-08-26 17:10:56
阅读次数:
261