iOS refact DoricLayout

This commit is contained in:
pengfei.zhou
2020-04-03 16:36:43 +08:00
committed by osborn
parent ca6a3284f2
commit abbe0ba377
32 changed files with 540 additions and 761 deletions

View File

@@ -35,12 +35,12 @@ - (instancetype)init {
return self;
}
- (void)layoutSelf:(CGSize)targetSize {
[super layoutSelf:targetSize];
if (!CGSizeEqualToSize(self.currentSize, targetSize) && self.frameChangedBlock) {
self.frameChangedBlock(self.currentSize, targetSize);
- (void)layoutSubviews {
[super layoutSubviews];
if (!CGSizeEqualToSize(self.currentSize, self.frame.size) && self.frameChangedBlock) {
self.frameChangedBlock(self.currentSize, self.frame.size);
}
self.currentSize = targetSize;
self.currentSize = self.frame.size;
}
- (void)setX:(CGFloat)x {
@@ -54,11 +54,12 @@ - (void)setY:(CGFloat)y {
@end
@implementation DoricRootNode
- (void)setupRootView:(DoricStackView *)view {
- (void)setupRootView:(UIView *)view {
view.doricLayout.layoutType = DoricStack;
self.view = view;
}
- (void)requestLayout {
[self.view setNeedsLayout];
[self.view.doricLayout apply];
}
@end