feat:Android only add DoricLayer when needed,and align contentview's size to refreshable itself
This commit is contained in:
@@ -49,8 +49,8 @@ - (DoricViewNode *)subNodeWithViewId:(NSString *)viewId {
|
||||
|
||||
- (void)blend:(NSDictionary *)props {
|
||||
[super blend:props];
|
||||
[self blendHeader];
|
||||
[self blendContent];
|
||||
[self blendHeader];
|
||||
}
|
||||
|
||||
- (void)blendContent {
|
||||
|
@@ -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;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user