views:

401

answers:

1

My comic book app is up and running but with a few things missing.

1) I want to have the images scroll from left to right, but I have the app automatically set itself up to landscape mode upon opening. Where to I tweak this part of the app? (btw...It is doing left to right in portrait mode)

2) I have two of my images showing...where do I add the other 22 images in my code through addSubView?

// load all the images from our bundle and add them to the scroll view
NSUInteger i;
for (i = 1; i <= kNumImages; i++)
{
 NSString *imageName = [NSString stringWithFormat:@"image%d.jpg", i];
 UIImage *image = [UIImage imageNamed:imageName];
 UIImageView *imageView = [[UIImageView alloc] initWithImage:image];

 // setup each frame to a default height and width, it will be properly placed when we call "updateScrollList"
 CGRect rect = imageView.frame;
 rect.size.height = kScrollObjHeight;
 rect.size.width = kScrollObjWidth;
 imageView.frame = rect;
 imageView.tag = i; // tag our images for later use when we place them in serial fashion
 [scrollView1 addSubview:imageView];
 [imageView release];

} [self layoutScrollImages]; // now place the photos in serial layout within the scrollview

}

A: 

It really depends on what you want to do. UIScrollView is for continuous scrolling -- if for example, you wanted the user to be able to view the right half of comic image 1 and the left half of comic image 2 at the same time.

If what you really want is for the images to be viewed more discretely (a "next page" / "previous page" paradigm), you might want to just have separate views and animate between them -- there would be no UIScrollView at all.

I can give you more specifics if you explain what behavior you actually want.

Amagrammer
Its basically like those comic book apps you see in the app store. You swipe and then you go into the next page. So i'm having a hard time setting it up in that manner. any ideas?
Dane
check out "the terminator: death valley # 1 by dark horse and thats exactly what i'm trying to achieve.
Dane