I have created a UIScrollView and added subviews to it in Interface Builder, but I am not able to get it to scroll. I have looked at other similar questions, but I have set
Try this code to auto set content size
first copy and paste your view controller in viewDidLoad Method
[self MHAutoContentSizeForScrollViewWithPadding:10 scrl:YOUR_SCROLLVIEW];
then copy and paste in below viewDidLoad Method
-(void)MHAutoContentSizeForScrollViewWithPadding:(CGFloat)padding scrl:(UIScrollView*)view{
if ([view isKindOfClass:[UIScrollView class]]) {
CGRect rect = CGRectZero;
for(UIView * view in YOUR_SCROLLVIEW.subviews){
rect = CGRectUnion(rect, view.frame);
}
[YOUR_SCROLLVIEW setContentSize:CGSizeMake(rect.size.width, rect.size.height+padding)];
} else {
NSLog(@"You can only set the ContentSize for ScrollViews");
}
}
connect YOUR_SCROLLVIEW delegate also and TextFeild Delegate also Happy Coding!!!