bugfix: fix originalContentInsetBottom not update bug#12
bugfix: fix originalContentInsetBottom not update bug#12bigyelow wants to merge 1 commit intoHisaMasa:masterfrom
Conversation
There was a problem hiding this comment.
需要调用一下 [self layoutLoadMoreView]?
There was a problem hiding this comment.
看起来不需要主动调用,layoutLoadMoreView 被调用的时候,这里的事情已经做过了。
|
是这样的,如果需要自定义 contentInset 需要在把 refresh 组件加到到scrollView之前就设置好 scrollView 的contentInset, |
|
能不能描述一下 使用场景呢? 需要后续再修改 contentInset? |
|
如果 UIScrollView 所在的 View Controller 是装在 UITabBarController 里的话,创建 UIScrollView 的时候 |
|
@crazytonyli 在加 refresh controller 之前手动设置 一下scrollView的contentInset呢? |
There was a problem hiding this comment.
其实这样最好,加上了状态的判断。
用 > 是因为最后的操作是 减去,考虑到系统加上的inset.bottom不会是负的。
if (scrollViewInsetBottom != self.originalContentInsetBottom
&& scrollViewInsetBottom != self.originalContentInsetBottom + loadMoreViewHeight) {
if (_enable && _autoLoadMore && scrollViewInsetBottom > self.originalContentInsetBottom + loadMoreViewHeight) {
self.originalContentInsetBottom = scrollViewInsetBottom - self.originalContentInsetBottom -loadMoreViewHeight;
}
else if (scrollViewInsetBottom > self.originalContentInsetBottom) {
self.originalContentInsetBottom = scrollViewInsetBottom - self.originalContentInsetBottom;
}
}
}
There was a problem hiding this comment.
如果要支持可设置 contentinset
有一种可能是 先变大后变小了 或者有可能为复数. 都囊括进去吧
|
这样的话等于可以直接暴露self.originalContentInset,然后Init的时候从外部来设置。 |
|
@bigyelow 其实不希望使用的人有太多负担, 并不希望他手动去改 originalContentInset |
No description provided.