Home  >  Q&A  >  body text

ios - scrollView里面嵌套一个tableview,如何屏蔽tableview的滚动,让scrollView直接响应手势滚动

tableview里面需要用到didSelected方法,所以不能讲tableview的userInteractionEnabled禁用掉(禁用后确实能达成效果,但是cell就无法点击了)

PHP中文网PHP中文网2741 days ago646

reply all(3)I'll reply

  • 大家讲道理

    大家讲道理2017-04-18 09:06:35

    tableview.scrollEnable = NO;

    reply
    0
  • 迷茫

    迷茫2017-04-18 09:06:35

    According to scrollView's contentoffset来设置它们在不同位置的滚动,scrollEnabled=NO或者Yes 关闭或者打开滚动,did scroll 里判断是tableView还是scrollView...进行相应的设置.两个都YES好像是会原地踏步滚不动,关掉上面的子视图滚动则父视图滚动,关掉父视图滚动,则子视图滚动...你设置userInteractionEnabled According to the event response delivery, you must have turned off all the views above this and cannot interact... This is my understanding, please point out if there is anything wrong.

    reply
    0
  • 天蓬老师

    天蓬老师2017-04-18 09:06:35

    tableview.scrollEnable = NO; Try this, disable sliding

    reply
    0
  • Cancelreply