美文网首页界面处理
cell侧滑时,出现线条

cell侧滑时,出现线条

作者: zmjchuan | 来源:发表于2016-10-28 11:39 被阅读4次

线条
解决方案:2种


1.设置高度,为整数


2.遍历tableView上的子view

遍历tableView中View:

ViewController.m
写在tableView中这个方法单独没有用,所以起作用的是下面的方法

tableViewCell中:
tableViewCell.m
注释:
1.可以不要的部分

CGRect frame =  self.contentView.subviews[0].frame;

frame.size.width = [UIScreen mainScreen].bounds.size.width - ((UIView *)[subView.subviews firstObject]).superview.frame.size.width;

self.contentView.subviews[0].frame = frame;

NSLog(@"--%@", NSStringFromCGRect(self.contentView.subviews[0].bounds));

这部分可以不要

2.解释部分:

NSLog(@"%@", NSStringFromCGRect(((UIView *)[subView.subviews firstObject].superview).frame)); 
打印的是UITableViewCellDeleteConfirmationView的frame,也就是@“图书”,@“教师”的父视图
NSLog(@"%@", (UIView *)[subView.subviews firstObject].superview);打印的是就是UITableViewCellDeleteConfirmationView

3.以上两个图片中的方法,第一个没有用

cell侧滑,跳转到另一个页面,时候后面的页面的手势消失了,需要添加,

pop回来前一页面时,cell侧滑的部分没有返回,可以将cell添加到scrollView上,

在页面viewWillAppear的时候,将scrollView的contentSize 设置为 0 0,但是这样的话tableView的点击手势就无效了,触摸不到,所以不行

对于工程:系统侧滑手势 9.23版本

相关文章

网友评论

    本文标题:cell侧滑时,出现线条

    本文链接:https://www.haomeiwen.com/subject/rgxeuttx.html