UIScroll view/Pinch help

Discussion in 'Public Game Developers Forum' started by WellSpentYouth, Apr 14, 2009.

  1. WellSpentYouth

    WellSpentYouth Well-Known Member

    Jan 11, 2009
    1,363
    6
    0
    iPhone programmer
    App Tech Studios, USA
    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!
     
  2. DrummerB

    DrummerB Well-Known Member

    Jan 17, 2009
    194
    0
    0
    Switzerland
    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.
     
  3. WellSpentYouth

    WellSpentYouth Well-Known Member

    Jan 11, 2009
    1,363
    6
    0
    iPhone programmer
    App Tech Studios, USA
    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!
     
  4. DrummerB

    DrummerB Well-Known Member

    Jan 17, 2009
    194
    0
    0
    Switzerland
    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.
     
  5. WellSpentYouth

    WellSpentYouth Well-Known Member

    Jan 11, 2009
    1,363
    6
    0
    iPhone programmer
    App Tech Studios, USA
    Thank you! I will test them. I appreciate it!
     
  6. WellSpentYouth

    WellSpentYouth Well-Known Member

    Jan 11, 2009
    1,363
    6
    0
    iPhone programmer
    App Tech Studios, USA
    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!
     
  7. DrummerB

    DrummerB Well-Known Member

    Jan 17, 2009
    194
    0
    0
    Switzerland
    I'm afraid I don't understand what you mean. :(
     
  8. WellSpentYouth

    WellSpentYouth Well-Known Member

    Jan 11, 2009
    1,363
    6
    0
    iPhone programmer
    App Tech Studios, USA
    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!
     
  9. DrummerB

    DrummerB Well-Known Member

    Jan 17, 2009
    194
    0
    0
    Switzerland
    Yes, I think that's how it's supposed to work. Or do you want it to work an other way?
     
  10. WellSpentYouth

    WellSpentYouth Well-Known Member

    Jan 11, 2009
    1,363
    6
    0
    iPhone programmer
    App Tech Studios, USA
    Well, I couldn't find anything about zooming :( Thanks though!
     
  11. DrummerB

    DrummerB Well-Known Member

    Jan 17, 2009
    194
    0
    0
    Switzerland
  12. WellSpentYouth

    WellSpentYouth Well-Known Member

    Jan 11, 2009
    1,363
    6
    0
    iPhone programmer
    App Tech Studios, USA
  13. arkanigon

    arkanigon Well-Known Member

    Dec 24, 2008
    439
    0
    0

Share This Page