views:

470

answers:

3

Hi Everyone:

I am wondering if there is some way to replicate Safari (on the iPhone's) tab behavior of scrolling through the webpages. Is it an API or some code that makes this happen, and how would I create this in my own app? I saw this post: http://stackoverflow.com/questions/1220354/uiscrollview-horizontal-paging-like-mobile-safari-tabs however I have not been able to follow the steps that the answer provided.

Thanks for any help!

EDIT: I have found the Apple Example called PageControl and have slightly modified it to display a small jpg instead of the colors. However, this lags a lot on scroll - So now my question is more if there is any way to make it not lag. Maybe some IB Preference that I missed transferring or a different file format?

+2  A: 

You should use png files, they are optimized for iphone.

willi
I think it is the other way around... ;) But I agree you should PNG where ever you can.
Jongsma
A: 

you should reduce transparency effects. non opaque controls cost a lot of performance.

Jaroslaw Szpilewski
A: 

Are you loading the images off screen?

The key is to only update the views +1 and -1 and to remove any views that are further away. Matt Gallagher did a nice write up of this:

http://cocoawithlove.com/2009/01/multiple-virtual-pages-in-uiscrollview.html

That should make your Scroll view screaming fast.

Corey Floyd