how to change contentSize,height,setContentOffset of the UIScrollView with iOS 8 Size Classes and Autolayout

522 Views Asked by At

I am using UIScrollView in Storyboard and the Subview on top of the scrollview now i am not able to update contentSize,height,setContentOffset of the UIScrollView at run time .i have added the constraints of the scrollview .in Storyboard. UIScrollview taking the height =800 that i added in Storyboard. now at the run time i want to change it contentSize <=1195 . enter image description here

i used this code to update

upperscrol.contentSize = CGSizeMake(upperscrol.frame.size.width, hieght);
upperscrol.delegate=self;
upperscrol.userInteractionEnabled=YES;

setting setContentOffset

 CGPoint bottomOffset = CGPointMake(0, [upperscrol contentSize].height - upperscrol.frame.size.height);
    [upperscrol setContentOffset:bottomOffset animated:YES];
[self.view addSubview:upperscrol];

this is my view hierarchy

what is the way to update height of the uiscrollview at run time

enter image description here

0

There are 0 best solutions below