关于tableview添加到self.view时,点击cell无反应

tableview添加到最下面时点击最下面的cell没反应,(如果下面有按钮,可能会穿透到下面的按钮去)是因为tabbar隐藏后,self.view的高度不是到最下面,tableview添加到self.view时,造成最后两行cell无反应,解决办法,在viewdidload中改变self.view的frame成全屏,解决。


问题2 当tableview和scrollview是同一级别,都加到self.view上面时,手势造成

冲突,如何解决?



- (void)touchesBegan:(NSSet*)touches withEvent:(UIEvent *)event

{

NSLog(@"touchesBegan");

CGPoint point = [[touches anyObject] locationInView:self.view];

point = [coverView.chooseLocationView.layer convertPoint:point fromLayer:self.view.layer];

NSLog(@"point--x==%f,point-y=%f",point.x,point.y);

if (coverView.hidden==NO) {

if ([coverView.chooseLocationView.layer containsPoint:point]) {

NSLog(@"点击了coverView.chooseLocationView");

mainScrollView.userInteractionEnabled = NO;

commitBtn.userInteractionEnabled = NO;

mainScrollView.scrollEnabled = NO;

}

else if(point.y<=0)

{

NSLog(@"点击了coverView的上部分");

}

}

else

{

point = [mainScrollView.layer convertPoint:point fromLayer:coverView.chooseLocationView.layer];

if ([mainScrollView.layer containsPoint:point]) {

NSLog(@"点击了mainScrollView");

mainScrollView.userInteractionEnabled = YES;

commitBtn.userInteractionEnabled = YES;

mainScrollView.scrollEnabled = YES;

}

}

}

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
【社区内容提示】社区部分内容疑似由AI辅助生成,浏览时请结合常识与多方信息审慎甄别。
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

相关阅读更多精彩内容

友情链接更多精彩内容