feat:step6
This commit is contained in:
parent
209a9267fe
commit
e3cb635358
@ -96,6 +96,9 @@ - (CGSize)measureSize:(CGSize)targetSize {
|
|||||||
- (void)layoutSelf:(CGSize)targetSize {
|
- (void)layoutSelf:(CGSize)targetSize {
|
||||||
self.width = targetSize.width;
|
self.width = targetSize.width;
|
||||||
self.height = targetSize.height;
|
self.height = targetSize.height;
|
||||||
|
for (UIView *view in self.subviews) {
|
||||||
|
[view layoutSelf:[view measureSize:targetSize]];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
- (BOOL)requestSuperview {
|
- (BOOL)requestSuperview {
|
||||||
@ -202,7 +205,8 @@ - (CGSize)sizeThatFits:(CGSize)size {
|
|||||||
}
|
}
|
||||||
|
|
||||||
- (void)layoutSelf:(CGSize)targetSize {
|
- (void)layoutSelf:(CGSize)targetSize {
|
||||||
[super layoutSelf:targetSize];
|
self.width = targetSize.width;
|
||||||
|
self.height = targetSize.height;
|
||||||
for (UIView *child in self.subviews) {
|
for (UIView *child in self.subviews) {
|
||||||
if (child.isHidden) {
|
if (child.isHidden) {
|
||||||
continue;
|
continue;
|
||||||
@ -288,7 +292,8 @@ - (CGSize)sizeThatFits:(CGSize)size {
|
|||||||
}
|
}
|
||||||
|
|
||||||
- (void)layoutSelf:(CGSize)targetSize {
|
- (void)layoutSelf:(CGSize)targetSize {
|
||||||
[super layoutSelf:targetSize];
|
self.width = targetSize.width;
|
||||||
|
self.height = targetSize.height;
|
||||||
CGFloat yStart = 0;
|
CGFloat yStart = 0;
|
||||||
if ((self.gravity & TOP) == TOP) {
|
if ((self.gravity & TOP) == TOP) {
|
||||||
yStart = 0;
|
yStart = 0;
|
||||||
@ -378,7 +383,8 @@ - (CGSize)sizeThatFits:(CGSize)size {
|
|||||||
}
|
}
|
||||||
|
|
||||||
- (void)layoutSelf:(CGSize)targetSize {
|
- (void)layoutSelf:(CGSize)targetSize {
|
||||||
[super layoutSelf:targetSize];
|
self.width = targetSize.width;
|
||||||
|
self.height = targetSize.height;
|
||||||
CGFloat xStart = 0;
|
CGFloat xStart = 0;
|
||||||
if (self.contentWeight) {
|
if (self.contentWeight) {
|
||||||
xStart = 0;
|
xStart = 0;
|
||||||
|
@ -41,7 +41,6 @@ - (CGSize)sizeThatFits:(CGSize)size {
|
|||||||
|
|
||||||
- (void)layoutSelf:(CGSize)targetSize {
|
- (void)layoutSelf:(CGSize)targetSize {
|
||||||
[super layoutSelf:targetSize];
|
[super layoutSelf:targetSize];
|
||||||
[self.contentView layoutSelf:[self.contentView sizeThatFits:targetSize]];
|
|
||||||
[self setContentSize:self.contentView.frame.size];
|
[self setContentSize:self.contentView.frame.size];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -25,6 +25,9 @@ @interface DoricSlideItemView : DoricStackView
|
|||||||
@end
|
@end
|
||||||
|
|
||||||
@implementation DoricSlideItemView
|
@implementation DoricSlideItemView
|
||||||
|
- (void)layoutSubviews {
|
||||||
|
[super layoutSubviews];
|
||||||
|
}
|
||||||
@end
|
@end
|
||||||
|
|
||||||
@implementation DoricSlideItemNode
|
@implementation DoricSlideItemNode
|
||||||
|
@ -45,12 +45,18 @@ - (CGSize)sizeThatFits:(CGSize)size {
|
|||||||
if (self.subviews.count > 0) {
|
if (self.subviews.count > 0) {
|
||||||
CGFloat height = size.height;
|
CGFloat height = size.height;
|
||||||
for (UIView *child in self.subviews) {
|
for (UIView *child in self.subviews) {
|
||||||
height = MAX(child.height, height);
|
CGSize childSize = [child measureSize:size];
|
||||||
|
height = MAX(childSize.height, height);
|
||||||
}
|
}
|
||||||
return CGSizeMake(height, size.height);
|
return CGSizeMake(size.width, size.height);
|
||||||
}
|
}
|
||||||
return size;
|
return size;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
- (void)layoutSelf:(CGSize)targetSize {
|
||||||
|
[super layoutSelf:targetSize];
|
||||||
|
[self reloadData];
|
||||||
|
}
|
||||||
@end
|
@end
|
||||||
|
|
||||||
@implementation DoricSliderNode
|
@implementation DoricSliderNode
|
||||||
|
Reference in New Issue
Block a user