Skip to content
This repository has been archived by the owner on Nov 29, 2022. It is now read-only.

DZNEmptyDataSet is overriding scrollEnabled #198

Closed
MarvinNazari opened this issue Feb 10, 2016 · 4 comments
Closed

DZNEmptyDataSet is overriding scrollEnabled #198

MarvinNazari opened this issue Feb 10, 2016 · 4 comments

Comments

@MarvinNazari
Copy link
Contributor

Hi, DZNEmptyDataSet is overriding the scrollEnabled, scrollEnabled for my UITableViewController is disabled and when I set the emptyDataSetSource and emptyDataSetDelegate, it enables the scrolling, is there any workaround for this?

@kevb10
Copy link

kevb10 commented Jul 5, 2016

Also #280

@dzenbot
Copy link
Owner

dzenbot commented Jul 12, 2016

Have you tried implementing emptyDataSetShouldAllowScroll:?

@zj381652512
Copy link

ths,got it

@monologue555
Copy link

我也遇到了这个问题。
EmptyDataSetSource 方法中调用了 dzn_invalidate 方法,
dzn_invalidate方法中执行了self.scrollEnabled = YES;
这么做的原因:在DZNEmptyDataSetView显示出来的时候调用了self.scrollEnabled = [self dzn_isScrollAllowed];然而dzn_invalidate方法是将之前的空页面移除,因此需要将self.scrollEnabled恢复到之前的设定。

是将self.scrollEnabled恢复到之前的设定,而不是YES。
所以需要用一个字段去保存之前用户的设置。

解决方案:

  1. 在DZNEmptyDataSetDelegate的emptyDataSetDidDisappear代理方法中再一次设置scrollView.scrollEnabled = NO;
  2. pod 'DZNEmptyDataSet', :git => 'https://github.com/monologue555/DZNEmptyDataSet'
  3. 等待我的PR被合并

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants