feat:Android only add DoricLayer when needed,and align contentview's size to refreshable itself

This commit is contained in:
pengfei.zhou
2019-11-28 10:28:24 +08:00
parent 10f159cfee
commit ddc1442815
12 changed files with 103 additions and 76 deletions

View File

@@ -49,8 +49,8 @@ - (DoricViewNode *)subNodeWithViewId:(NSString *)viewId {
- (void)blend:(NSDictionary *)props {
[super blend:props];
[self blendHeader];
[self blendContent];
[self blendHeader];
}
- (void)blendContent {

View File

@@ -5,6 +5,7 @@
#import "DoricSwipeRefreshLayout.h"
#import "UIView+Doric.h"
#import "DoricLayouts.h"
#import "Doric.h"
@interface DoricSwipeRefreshLayout () <UIScrollViewDelegate>
@@ -53,9 +54,16 @@ - (BOOL)requestFromSubview:(UIView *)subview {
}
- (void)layoutSelf:(CGSize)targetSize {
[super layoutSelf:targetSize];
self.headerView.bottom = 0;
self.headerView.centerX = self.centerX;
self.width = targetSize.width;
self.height = targetSize.height;
[self.headerView also:^(UIView *it) {
[it layoutSelf:[it measureSize:targetSize]];
it.bottom = 0;
it.centerX = self.centerX;
}];
[self.contentView also:^(UIView *it) {
[it layoutSelf:targetSize];
}];
self.contentSize = self.frame.size;
}