change label based on the position of a scrollview...

Discussion in 'iOS Programming' started by Alan Taylor, Jun 25, 2009.

  1. Alan Taylor macrumors 6502

    Alan Taylor

    Joined:
    May 14, 2006
    Location:
    Mississauga
    #1
    I am still a newbie iPhone programmer - my first app Discounted is currently in Apple review and should come out any day now - and I am working on my next project. I am still in the planning stages but I have come across something that I am not sure how to go about implementing.

    For the help screen I wish to have several images of the app in action, with a label underneath that explains what to do at each stage. I thought I could do this with buttons - which when pressed with show the next picture and label - I could even have it fade out and in to the new one.

    But ideally I would like to have something similar to the Photos app or even the pictures in the App Store, where the user can drag along and the next photo will pull in. But I'm not sure how to have the pictures bounce into place like they do in those apps - is it a feature of UIScrollView?

    More importantly, I am not sure how to tell which picture is currently the one being shown so that I can update the label with the correct text. In a perfect world the text would have an alpha of 1 when the image is in the center and would fade out/in as the images are dragged...

    I have included an image of what I currently have and what I would like to have - if anyone has any ideas I would love to hear them!!!

    [​IMG]
     
  2. PhoneyDeveloper macrumors 68030

    PhoneyDeveloper

    Joined:
    Sep 2, 2008
    #2
    Look at the PageControl example app.

    Consider doing this with html and a UIWebView. You won't get the swiping behavior but can use next/previous buttons.

    Users never read the help text anyway.
     
  3. Alan Taylor thread starter macrumors 6502

    Alan Taylor

    Joined:
    May 14, 2006
    Location:
    Mississauga
    #3
    Thanks - I think UIPageControl is exactly what I'm looking for - but it seems to add a lot of complication for something that, as you say, will probably be seen just once if that.

    I think I have been over engineering this part of my app :)
     
  4. dejo Moderator

    dejo

    Staff Member

    Joined:
    Sep 2, 2004
    Location:
    The Centennial State
    #4
    Perhaps just a UIScrollView that contains the entire content, neatly broken up into "pages" of the screen width, and turning on pagingEnabled will do the trick.
     
  5. Alan Taylor thread starter macrumors 6502

    Alan Taylor

    Joined:
    May 14, 2006
    Location:
    Mississauga
    #5
    This seems like a good idea - I will look into it. I have never really explored the scrollviews but this seems like as good an excuse as any!
     

Share This Page