123456789101112131415161718192021222324252627282930313233343536373839404142 |
- //
- // AutoLayoutScrollView.m
- // smartRhino
- //
- // Created by tederen on 2019/11/2.
- // Copyright © 2019 tederen. All rights reserved.
- //
- #import "AutoLayoutScrollView.h"
- @implementation AutoLayoutScrollView
- -(void) autoContentSize:(Oritation) type{
-
- CGFloat width = 0;
- CGFloat height= 0;
-
- for (UIView* view in self.subviews){
- height += view.frame.size.height;
- width += view.frame.size.width;
- }
-
- switch (type) {
-
- case horizontal:{
- self.contentSize = CGSizeMake(width, 0.0f);
- }
- break;
-
- case vertical:{
-
- self.contentSize = CGSizeMake(0.0f, height);
-
- }break;
-
- default:
- break;
- }
-
- }
- @end
|