feat:step3:scrollview
This commit is contained in:
@@ -34,11 +34,16 @@ - (void)setContentView:(UIView *)contentView {
|
||||
|
||||
- (CGSize)sizeThatFits:(CGSize)size {
|
||||
if (self.contentView) {
|
||||
CGSize childSize = [self.contentView sizeThatFits:size];
|
||||
return CGSizeMake(MIN(size.width, childSize.width), MIN(size.height, childSize.height));
|
||||
return [self.contentView sizeThatFits:size];
|
||||
}
|
||||
return CGSizeZero;
|
||||
}
|
||||
|
||||
- (void)layoutSelf:(CGSize)targetSize {
|
||||
[super layoutSelf:targetSize];
|
||||
[self.contentView layoutSelf: [self.contentView sizeThatFits:targetSize]];
|
||||
[self setContentSize:self.contentView.frame.size];
|
||||
}
|
||||
@end
|
||||
|
||||
@interface DoricScrollerNode ()
|
||||
|
||||
Reference in New Issue
Block a user