I tried sample code in App Dev Center, but the code only can show images side by side and fill all scroll view, I want to realize like attached picture, who can give me some thoughts? Thanks~!
Asked
Active
Viewed 290 times
1 Answers
1
The width of a "page" when you use a paging scroll view is the width of the scroll view itself. So if you want to use that feature, the scroll view must be the width of the pix plus half the width of the borders on either side, so that the next picture will come into place correctly. Now, if you don't want to hide the picture at the right before it's been paged into the scroll view, just don't turn on clipsToBounds
.

matt
- 515,959
- 87
- 875
- 1,141
-
Could you show me a simple sample on how to set the width of the scrollview? I have a little bit confuse on it. – Xcobe Jan 10 '12 at 02:58
-
Not sure what you're asking. Width means width (of the frame or bounds). You can set it in the nib/storyboard editor or in code. The point is, whatever the value of `theScrollView.bounds.size.width` is, that's how many pixels the content will shift when the user pages; the user can scroll only in units of that amount. So you just have to plan ahead with the placement of those images. – matt Jan 19 '12 at 19:49