I have used UIScrollView named “scrMainView”.
I have defined its property in .xib file as x=0, y=260, width=320, height=1860.
So now Button click event, I want scrollview up. ie. y=80. rest of parameters remain as it is.
I have used code :
[scrMainView scrollRectToVisible:CGRectMake(0,-180, 320, 2800) animated:NO];
scrMainView.contentOffset = CGPointMake(0, -180);
I have used either of both lines. But it give same output as it focuses scrollview.
But I want to change Y position. So ScrollView appears more upside on screen area.
I have defined in property in .xib already. So will this effect on dynamic code..?
Any Solution..?
Thanks.
You need to set the
frameproperty of the UIScrollView.