iOS:fix Refreshable
This commit is contained in:
@@ -100,7 +100,6 @@ - (void)blendContent {
|
||||
self.view.contentView = it.view;
|
||||
}];
|
||||
}
|
||||
[self.view.contentView.doricLayout apply:self.view.frame.size];
|
||||
}
|
||||
|
||||
- (void)blendHeader {
|
||||
@@ -137,7 +136,13 @@ - (void)blendHeader {
|
||||
self.view.headerView = it.view;
|
||||
}];
|
||||
}
|
||||
}
|
||||
|
||||
- (void)requestLayout {
|
||||
[self.view.headerView.doricLayout apply:self.view.frame.size];
|
||||
self.view.headerView.bottom = 0;
|
||||
self.view.headerView.centerX = self.view.width / 2;
|
||||
[self.view.contentView.doricLayout apply:self.view.frame.size];
|
||||
}
|
||||
|
||||
- (void)blendSubNode:(NSDictionary *)subModel {
|
||||
|
@@ -77,6 +77,14 @@ - (void)setHeaderView:(UIView *)headerView {
|
||||
self.refreshable = YES;
|
||||
}
|
||||
|
||||
- (void)layoutSubviews {
|
||||
[super layoutSubviews];
|
||||
if (self.contentOffset.y != 0) {
|
||||
return;
|
||||
}
|
||||
self.contentSize = self.frame.size;
|
||||
}
|
||||
|
||||
- (void)scrollViewDidEndDragging:(UIScrollView *)scrollView willDecelerate:(BOOL)decelerate {
|
||||
if (-scrollView.contentOffset.y >= self.headerView.height) {
|
||||
dispatch_async(dispatch_get_main_queue(), ^{
|
||||
|
Reference in New Issue
Block a user