I created a UIScrollView and SubView in XCode 5 and iOS 7. Its Working fine but I am running in XCode 7 and its not scrolling. I set AutoLayouts to UIScrollview. I wrote code in ViewDidLayoutSubviews Method.
billViewScrolled2 is CustomView (UIView)
-(void)viewdidload{
[super viewdidload];
self.scrollViewTwo.translatesAutoresizingMaskIntoConstraints = NO;
self.billViewScrolled2.translatesAutoresizingMaskIntoConstraints = NO;
}
-(void)viewDidLayoutSubviews
{
[self.scrollViewTwo setContentSize:CGSizeMake(self.billViewScrolled2.frame.size.width, 21 * [billDataArray count])];
if (self.billViewScrolled2) {
UIEdgeInsets scrollViewInsets = UIEdgeInsetsZero;
scrollViewInsets.bottom = (CGRectGetHeight(self.scrollViewTwo.bounds) - CGRectGetHeight(self.billViewScrolled2.bounds)) / [billDataArray count]+ 160;
self.scrollViewTwo.contentInset = scrollViewInsets;
} else if (self.billViewScrolled2)
self.scrollViewTwo.contentSize = CGSizeMake(CGRectGetWidth(self.view.bounds), CGRectGetHeight(self.view.bounds) + 1.0f);
}
Please help me.