iOS:refact requestLayout logic
This commit is contained in:
@@ -20,7 +20,6 @@
|
||||
#import "DoricSwipeRefreshLayout.h"
|
||||
#import "UIView+Doric.h"
|
||||
#import "DoricLayouts.h"
|
||||
#import "Doric.h"
|
||||
|
||||
@interface DoricSwipeRefreshLayout () <UIScrollViewDelegate>
|
||||
|
||||
@@ -54,41 +53,13 @@ - (instancetype)init {
|
||||
return self;
|
||||
}
|
||||
|
||||
//- (CGSize)sizeThatFits:(CGSize)size {
|
||||
// if (self.contentView) {
|
||||
// return [self.contentView measureSize:size];
|
||||
// }
|
||||
// return CGSizeZero;
|
||||
//}
|
||||
//
|
||||
//- (BOOL)requestFromSubview:(UIView *)subview {
|
||||
// if (subview == self.headerView) {
|
||||
// return NO;
|
||||
// }
|
||||
// return [super requestFromSubview:subview];
|
||||
//}
|
||||
|
||||
- (void)layoutSubviews {
|
||||
[super layoutSubviews];
|
||||
- (CGSize)sizeThatFits:(CGSize)size {
|
||||
if (self.contentView) {
|
||||
return self.contentView.frame.size;
|
||||
}
|
||||
return CGSizeZero;
|
||||
}
|
||||
|
||||
//- (void)layoutSelf:(CGSize)targetSize {
|
||||
// if (self.contentOffset.y != 0) {
|
||||
// return;
|
||||
// }
|
||||
// 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;
|
||||
//}
|
||||
|
||||
- (void)setContentView:(UIView *)contentView {
|
||||
if (_contentView) {
|
||||
[_contentView removeFromSuperview];
|
||||
|
||||
Reference in New Issue
Block a user