原理: tableview的调用 -(UITableViewCell*)tableView:(UITableView*)tableView cellForRowAtIndexPath:(NSIndexPath*)indexPath方法 判断indexPath.row和服务器每页返回的数据的count ...
分类:
其他好文 时间:
2017-10-09 13:17:21
阅读次数:
268
// 响应单元格右滑手势 override func tableView(_ tableView: UITableView, editActionsForRowAt indexPath: IndexPath) -> [UITableViewRowAction]? { let actionShare ... ...
分类:
移动开发 时间:
2017-09-10 00:16:07
阅读次数:
243
- (void)tableView:(UITableView *)tableView willDisplayCell:(UITableViewCell *)cell forRowAtIndexPath:(NSIndexPath *)indexPath{ cell.separatorInset = U ...
分类:
移动开发 时间:
2017-08-21 16:30:28
阅读次数:
160
// 注意判断条件, override func prepare(for segue: UIStoryboardSegue, sender: Any?) { if let cell = sender as? UICollectionViewCell, let indexPath = collecti ...
分类:
编程语言 时间:
2017-08-16 18:22:12
阅读次数:
178
-(void)tableView:(UITableView *)tableView willDisplayCell:(UITableViewCell *)cell forRowAtIndexPath:(NSIndexPath *)indexPath{ CATransform3D rotation; ...
分类:
其他好文 时间:
2017-08-05 10:57:51
阅读次数:
192
如果在reloadData后需要立即获取tableview的cell、高度,或者需要滚动tableview。 如果直接在reloadData后执行代码是有可能出问题的,比如indexPath为nil等等异常情况。 [tableView reloadData]并不会等待tableview更新结束后才执 ...
分类:
移动开发 时间:
2017-07-05 01:22:15
阅读次数:
442
//侧滑-(NSArray )tableView:(UITableView )tableView editActionsForRowAtIndexPath:(NSIndexPath )indexPath{NSStringindexPathRow = [NSString stringWithForma ...
分类:
其他好文 时间:
2017-06-29 19:10:28
阅读次数:
136
第一条:UITableViewCell 内容的设置 //文本放到最后 NSIndexPath *indexPath = [NSIndexPath indexPathForRow:_dataArr.count - 1 inSection:0]; [_tableView scrollToRowAtInd ...
分类:
移动开发 时间:
2017-05-16 14:54:11
阅读次数:
264
如何获取手指点击的cell位置: 1,首先创建一个长按(可以是点击或者其他手势) UILongPressGestureRecognizer * longgr = [[UILongPressGestureRecognizer alloc] initWithTarget:self action:@sel ...
分类:
移动开发 时间:
2017-05-09 16:54:49
阅读次数:
275
效果: collectionView的数据源方法 - (UICollectionViewCell *) collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath ...
分类:
其他好文 时间:
2017-05-06 20:48:33
阅读次数:
160