0
  1. I want a UIScrollView in which i have to paste 25 images of same size(256*256).
  2. The 13th picture should come in the centre,ie, when the app loades.
  3. Then when i swipe right, left, up or down it should scroll as normally.

For doing this what should be the specifications of the UIScrollView,ie, 1.what should be its size 2.ContentViewSize 3.where should be its origin.

Halle
  • 3,584
  • 1
  • 37
  • 53
wolverine
  • 2,967
  • 5
  • 31
  • 35
  • You need to elaborate more. Do you want a single picture visible at a time? Did you want the initial view to be showing the 13th picture with 12 on either (left/right) side of it out of view? If so, what's with the up/down scrolling since 256x256 would fit completely inside the dimensions of the screen. – wkw Dec 03 '09 at 13:33
  • Actually I did it. I created a scrollView with size of the screen. Then made the contentSize as 1280*1280. Then made the 13th picture at dimensions at the centre as (512,512). Then made some mathematical calculations so that i get the contentOffset value to make the centre picture visible at the centre of the screen. What I am aiming to do is an infinite scroll. When i swipe to any direction, before it reaches the end picure on that side I want new pictures to be coming on the ends. Dont know how to explain it. Just like a mapView. But I want to do that feature with a lot of images – wolverine Dec 04 '09 at 03:45

1 Answers1

1

If your scrollView is going to be shown full-screen in portrait orientation, you should use the following sizes (assuming you don't hide the status bar):

  • UIScrollView frame: 320 x 460
  • contentSize: 8000 x 460 initial
  • contentOffset: (3840 , 0)
Philippe Leybaert
  • 168,566
  • 31
  • 210
  • 223
  • Actually I did it. And i have given the solution above. Do you have any idea how to create an infinte scroll using UIScrollView. With pictures loading on any end it goes so that it appears like a MapKit? Any answer would be of gr8 help. – wolverine Dec 04 '09 at 03:48
  • I see that you asked another question in that regard: http://stackoverflow.com/questions/1845789/how-to-create-a-uiscrollview-of-infinite-scrolling – Brad Larson Dec 06 '09 at 15:31