iOS: Slider support fit size and slidePosition

This commit is contained in:
pengfei.zhou
2023-04-04 19:50:44 +08:00
committed by osborn
parent 930593fe0c
commit 18d5050c7a
2 changed files with 52 additions and 3 deletions

View File

@@ -25,6 +25,13 @@ @interface DoricNestedSliderView : UIScrollView
@end
@implementation DoricNestedSliderView
- (CGSize)sizeThatFits:(CGSize)size {
CGSize result = [super sizeThatFits:size];
if (self.doricLayout.heightSpec == DoricLayoutFit && self.contentSize.height > 0) {
return CGSizeMake(result.width, self.contentSize.height);
}
return result;
}
@end
@interface DoricNestedSliderNode () <UIScrollViewDelegate>