views:

178

answers:

2

I have an iPhone application that uses a UIScrollView to display a larger version of an image on the main screen. I am using IB to create the main screen that has text, small images, and price about a product. I have it setup to show/hide the UIScrollView if the user touches the small images. It works ok, but things are pretty messing in the IB layout. I have to put the UIScrollView over top of everything else and make it hidden by default. What I'd like to know is if there is a better way to accomplish this. Can I create a new nib and load the scroll view in it and load that nib when the users touches the small image? Should I construct the scroll view in my code and not use IB? Any input is appreciated!

Sorry if this is a newb question. I'm still learning.

A: 

Assume that scrv is the scrollview object.

you can change the content size of scroll view through code.

so as and when needed you can set content size.

[scrv setContentSize:CGSizeMake(300, 500)]; // set content size bigger

[scrv setContentSize:CGSizeMake(15, 50)]; // set content size smaller

set it into your required action - IBAction

it will work

i have implemented it in my application.

Best of luck

sugar
A: 

Set scrollView.hidden = YES and then when tapped, set it to NO.

Matthew Bischoff