美文网首页IOS问题处理
iOS巧妙解决侧滑返回失效

iOS巧妙解决侧滑返回失效

作者: pokeey | 来源:发表于2019-11-04 16:55 被阅读0次

iOS侧滑返回失效多是因为和scorllview手势冲突,在左侧加一个安全距离的透明view覆盖在scrollview上这样就可以在侧滑时屏蔽掉scrollview的手势,从而解决这个问题

UIView *safeView = [[UIView alloc] init];
[safeView setBackgroundColor:[UIColor clearColor]];
 [self.view addSubview:safeView];
[safeView mas_makeConstraints:^(MASConstraintMaker *make) {
            make.bottom.top.left.mas_equalTo(self.view);
            make.width.mas_equalTo(10);
  }];

相关文章

网友评论

    本文标题:iOS巧妙解决侧滑返回失效

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