views:

185

answers:

1

Hi All,

I have seen the WWDC-104 video showing UIScrollView for photos. I have downloaded the Sample code too. In my app the Structure is as follows,

(Root Class)Class A ---> Class B -----------> PhotoViewController(Containing ScrollView)

I am calling the PhotoViewController class by using presentModalViewController method in Class B.

But with every swipe the new Image shifts to right on the view. A black vertical strip is visible on left of the image which widens with each swipe. So after 6 to 8 images the view becomes totally black.

I have not written any other code. Just copied the classes.

Why this happens when the PhotoViewController class is not the first class to be loaded? Is there any property that needs to be set for ScrollView ? Is there any mistake in this view Hierarchy?

Also How to start from a particular image (Load from 10th image)?

Any help/suggestion will be highly appreciated.

EDIT :

alt text

After First Horizontal Swipe,

alt text

After Second Horizontal Swipe,

alt text

A: 

it sounds like you may not be taking the inter-image margin into account. Did you also copy their resource files? If I recall correctly, their scrollview extended 'off the page' a bit to give a margin between images.

Ben Gottlieb
Yes..The margin is there between images but it is done programatically and code is there for that. Problem is same app runs perfectly when my first class is PhotoViewController but when when I call it from some other button click then this problem occurs.
Roger_iPhone