In UIScrollView, I have content height and width greater than scrollview's size. So basically it can scroll horizontally and vertically. What I want is to scroll vertically only and I manage horizontally scroll using an UIButton by using below code.
[scrlViewQuestion setContentOffset:CGPointMake(questionWidth, 0) animated:YES];
Preventing horizontal scrollview, one can just set scrollview content width lesser than scrollview size but in my case scrollview content width is greater than its size? So what is the best way to solve this?



Set the
contentSizeof your scrollview to the width of your screen and the actual height of your scrollable content. Set thecontentInsetto zero for thetop,bottom, andright. For the content inset on theleftalways choose the negatedxcoordinate of the position you currently want to display.E.g. if your screen is 320 points wide, and you want to display content with horizontal scrolling fixed at
x, but vertical scrolling allowed: