// // 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