0

I know about the contentInset on UIScrollView, however I'm trying to achieve something slightly different: I want to have a "viewport" on the scrollview: essentially have all the content scroll within the scrollview but at all times have a blank padding on all sides.

In CSS terms, I want to achieve {height: 300px; padding: 10px; overflow: scroll;}

Is this possible and, if yes, how would I do that?

Aleks G
  • 56,435
  • 29
  • 168
  • 265
  • hm, not the answer, but maybe a solution. What if you remove 20px height, 20px width, add 10px top and 10px left? At least it is the same result as padding i think. :) – Retterdesdialogs May 25 '12 at 13:36
  • @Retterdesdialogs I'm not sure I follow. what do you mean by "remove"? – Aleks G May 25 '12 at 13:43
  • scrollview.frame = CGRectMake(10,10,300,460); instead of scrollview.frame = CGRectMake(0,0,320,480); – Retterdesdialogs May 25 '12 at 13:46
  • But that defeats the purpose. The scrollview has a background with 0.8 alpha and is positioned on another UIView with its own background of 0.8 alpha - and the whole thing is over the screen, which has an image for the background. – Aleks G May 25 '12 at 13:52

0 Answers0