Help with UIScrollView?

Discussion in 'iOS Programming' started by mandude, Dec 7, 2010.

  1. mandude macrumors member

    Joined:
    Nov 19, 2009
    #1
    hey all I'm trying to make an app on my favorite playing card game and i need some guidance on an issue. I'm trying to make the player's hand of cards appear on the screen similar to how the iOS4 multitasking menu is. On the bottom of the screen would be a ScrollView I'm thinking and the player can simply swipe horizontally to see all the cards they have. The player is originally dealt 4 cards, so on the bottom of the screen would be the four imageviews of the cards in a scroll view. If the player only has four cards or less then I'd like a bounce back effect to occur on the sides. However if the player has more than 4 cards in their hand, (which would mean the screen wouldn't fit the entire hand), then the scrollView should allow the player to scroll to the left or right to see the rest of their cards. So my main question is how do i set up a Scrollview on the bottom of the screen, and function almost identical to the interface in the iOS4 Multitasking menu? Thats only half the trouble for me though. After i have the imageViews in the scrollView and it all works good, I would need the Imageviews (cards) be able to be touched by the user, and followed by their finger out of the scrollView and into the original UIView all help is appreciated
     
  2. chown33 macrumors 604

    Joined:
    Aug 9, 2009
    #2
    I think scrolling is a mistake. Do what card players do in the real world: overlap the cards.
     
  3. mandude thread starter macrumors member

    Joined:
    Nov 19, 2009
    #3
    Wirelessly posted (Mozilla/5.0 (iPhone; U; CPU iPhone OS 4_2_1 like Mac OS X; en-us) AppleWebKit/533.17.9 (KHTML, like Gecko) Version/5.0.2 Mobile/8C148 Safari/6533.18.5)

    Yet in this particular game the player will usually have well over 30 cards in their hand. Overlapping is possible but I dont think it will be able to fit all the cards
     
  4. mandude thread starter macrumors member

    Joined:
    Nov 19, 2009
  5. ulbador macrumors 68000

    ulbador

    Joined:
    Feb 11, 2010
    #5
    Create a view that is as tall as you want the scroll view to be. Then set up it to be really wide, like 320*4 or 6, which would give you 4 or 6 screens.. Then just attach it...
     
  6. mandude thread starter macrumors member

    Joined:
    Nov 19, 2009

Share This Page