feat:step3:scrollview

This commit is contained in:
pengfei.zhou
2019-11-27 16:04:43 +08:00
parent af8a455d46
commit 1dabccbe50
4 changed files with 20 additions and 10 deletions

View File

@@ -94,7 +94,7 @@ - (CGSize)measureSize:(CGSize)targetSize {
* layout self and subviews
* */
- (void)layoutSelf:(CGSize)targetSize {
CGSize contentSize = [self measureSize:targetSize];
CGSize contentSize = [self sizeThatFits:targetSize];
if (self.layoutConfig.widthSpec == DoricLayoutAtMost) {
self.width = targetSize.width;
} else if (self.layoutConfig.widthSpec == DoricLayoutWrapContent) {
@@ -108,8 +108,7 @@ - (void)layoutSelf:(CGSize)targetSize {
}
- (BOOL)requestSuperview {
return self.superview
&& self.layoutConfig
return self.layoutConfig
&& self.layoutConfig.widthSpec != DoricLayoutExact
&& self.layoutConfig.heightSpec != DoricLayoutExact;
}