-
Notifications
You must be signed in to change notification settings - Fork 10
bugfix: fix originalContentInsetBottom not update bug #12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
需要调用一下 [self layoutLoadMoreView]?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
看起来不需要主动调用,layoutLoadMoreView 被调用的时候,这里的事情已经做过了。
|
是这样的,如果需要自定义 contentInset 需要在把 refresh 组件加到到scrollView之前就设置好 scrollView 的contentInset, |
|
能不能描述一下 使用场景呢? 需要后续再修改 contentInset? |
|
如果 UIScrollView 所在的 View Controller 是装在 UITabBarController 里的话,创建 UIScrollView 的时候 |
|
@crazytonyli 在加 refresh controller 之前手动设置 一下scrollView的contentInset呢? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这里应该是 != 会更好一点吧?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
其实这样最好,加上了状态的判断。
用 > 是因为最后的操作是 减去,考虑到系统加上的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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
如果要支持可设置 contentinset
有一种可能是 先变大后变小了 或者有可能为复数. 都囊括进去吧
|
这样的话等于可以直接暴露self.originalContentInset,然后Init的时候从外部来设置。 |
|
@bigyelow 其实不希望使用的人有太多负担, 并不希望他手动去改 originalContentInset |
No description provided.