★ TouchArcade needs your help. Click here to support us on Patreon.

UIScroll view/Pinch help

04-14-2009, 11:57 AM
#1
Joined: Jan 2009
Location: App Tech Studios, USA
Posts: 1,363
UIScroll view/Pinch help

I was thinking that it would be fun to have a pinch/scroll view, but I don't know how to make one. For eg: Safari on the iPhone has pinching and scrolling on it.

How can I implement that into my view? Thank you!
04-14-2009, 04:02 PM
#2
Joined: Jan 2009
Location: Switzerland
Posts: 194
Send a message via AIM to DrummerB Send a message via MSN to DrummerB
UIWebView has scrolling and pinching support, but it can only show html files. I think UIScrollView does support scrolling & pinching as well. You have to add a bigger subview to it and allow pinching (zooming) if it's not allowed by default.

04-14-2009, 04:11 PM
#3
Joined: Jan 2009
Location: App Tech Studios, USA
Posts: 1,363
Quote:
Originally Posted by DrummerB View Post
UIWebView has scrolling and pinching support, but it can only show html files. I think UIScrollView does support scrolling & pinching as well. You have to add a bigger subview to it and allow pinching (zooming) if it's not allowed by default.
Thanks! Can you be more specific though? Is there any code that I have to do? Is there a sample project in the Dev Center? Thanks!
04-14-2009, 05:16 PM
#4
Joined: Jan 2009
Location: Switzerland
Posts: 194
Send a message via AIM to DrummerB Send a message via MSN to DrummerB
These might be helpful:
Scrolling sample.
Page Control sample.

Read the documentation of UIScrollView. Just open XCode, write "UIScrollView", double click it to select, Ctrl+click (or right click) and select API documentation.
04-14-2009, 05:26 PM
#5
Joined: Jan 2009
Location: App Tech Studios, USA
Posts: 1,363
Quote:
Originally Posted by DrummerB View Post
These might be helpful:
Scrolling sample.
Page Control sample.

Read the documentation of UIScrollView. Just open XCode, write "UIScrollView", double click it to select, Ctrl+click (or right click) and select API documentation.
Thank you! I will test them. I appreciate it!
04-14-2009, 05:48 PM
#6
Joined: Jan 2009
Location: App Tech Studios, USA
Posts: 1,363
Ok, thanks! I still have a problem. Let me just say what I want to do and then you could probably help me better. So what I want to do is have 20 buttons on the screen and then you have to zoom in and then tap them, but if you have a scroll view you can't do that because when you scroll the background changes where as if you are just zooming, the buttons stay over the same images.


Does this make sense? Thanks!
04-14-2009, 06:19 PM
#7
Joined: Jan 2009
Location: Switzerland
Posts: 194
Send a message via AIM to DrummerB Send a message via MSN to DrummerB
I'm afraid I don't understand what you mean.
04-14-2009, 06:20 PM
#8
Joined: Jan 2009
Location: App Tech Studios, USA
Posts: 1,363
Ok, here is another way to explain what my goal is:


You have a connect the dots game. There are 20 dots labeled 1-20 all over an image. You have to tap each of the dots in there numeric order. You can zoom in (pinch) to take a closer at the dots and to make sure the numbers are correct. When you zoom in, the buttons expand, because the image is also expanding. (exactly like safari)


Thank you!
04-14-2009, 06:23 PM
#9
Joined: Jan 2009
Location: Switzerland
Posts: 194
Send a message via AIM to DrummerB Send a message via MSN to DrummerB
Yes, I think that's how it's supposed to work. Or do you want it to work an other way?
04-14-2009, 10:44 PM
#10
Joined: Jan 2009
Location: App Tech Studios, USA
Posts: 1,363
Quote:
Originally Posted by DrummerB View Post
Yes, I think that's how it's supposed to work. Or do you want it to work an other way?
Well, I couldn't find anything about zooming Thanks though!