feat:step6

This commit is contained in:
pengfei.zhou
2019-11-27 17:17:03 +08:00
parent 209a9267fe
commit e3cb635358
4 changed files with 20 additions and 6 deletions

View File

@@ -96,6 +96,9 @@ - (CGSize)measureSize:(CGSize)targetSize {
- (void)layoutSelf:(CGSize)targetSize {
self.width = targetSize.width;
self.height = targetSize.height;
for (UIView *view in self.subviews) {
[view layoutSelf:[view measureSize:targetSize]];
}
}
- (BOOL)requestSuperview {
@@ -202,7 +205,8 @@ - (CGSize)sizeThatFits:(CGSize)size {
}
- (void)layoutSelf:(CGSize)targetSize {
[super layoutSelf:targetSize];
self.width = targetSize.width;
self.height = targetSize.height;
for (UIView *child in self.subviews) {
if (child.isHidden) {
continue;
@@ -288,7 +292,8 @@ - (CGSize)sizeThatFits:(CGSize)size {
}
- (void)layoutSelf:(CGSize)targetSize {
[super layoutSelf:targetSize];
self.width = targetSize.width;
self.height = targetSize.height;
CGFloat yStart = 0;
if ((self.gravity & TOP) == TOP) {
yStart = 0;
@@ -378,7 +383,8 @@ - (CGSize)sizeThatFits:(CGSize)size {
}
- (void)layoutSelf:(CGSize)targetSize {
[super layoutSelf:targetSize];
self.width = targetSize.width;
self.height = targetSize.height;
CGFloat xStart = 0;
if (self.contentWeight) {
xStart = 0;