iOS:fix Scroller

This commit is contained in:
pengfei.zhou
2020-04-03 18:15:43 +08:00
committed by osborn
parent 2e0bbcfb89
commit eb78e3e201
3 changed files with 29 additions and 24 deletions

View File

@@ -69,16 +69,20 @@ - (instancetype)init {
return self;
}
- (void)apply {
- (void)apply:(CGSize)frameSize {
if (!CGAffineTransformEqualToTransform(self.view.transform, CGAffineTransformIdentity)) {
return;
}
self.resolved = NO;
[self measure:self.view.frame.size];
[self measure:frameSize];
[self layout];
[self setFrame];
}
- (void)apply {
[self apply:self.view.frame.size];
}
- (void)measure:(CGSize)targetSize {
if (self.widthSpec == DoricLayoutMost) {
self.measuredWidth = targetSize.width;
@@ -433,7 +437,7 @@ - (void)layoutHLayout {
if ((gravity & DoricGravityTop) == DoricGravityTop) {
layout.measuredY = self.paddingTop;
} else if ((gravity & DoricGravityBottom) == DoricGravityBottom) {
layout.measuredY = self.measuredHeight - self.paddingBottom - child.height;
layout.measuredY = self.measuredHeight - self.paddingBottom - layout.measuredHeight;
} else if ((gravity & DoricGravityCenterY) == DoricGravityCenterY) {
layout.measuredY = self.measuredHeight / 2 - layout.measuredHeight / 2;
} else {