UISlider position

Discussion in 'iPhone/iPad Programming' started by nickculbertson, Apr 24, 2011.

  1. macrumors regular

    nickculbertson

    Joined:
    Nov 19, 2010
    Location:
    Nashville, TN
    #1
    Hello,
    I am wondering is there a way to have the ball of a slider move directly to the point that is touched without sliding to that point. For example the ball is on the far left and when I touch down on the right side of the slider, the ball is moved to where I touched.
    Thanks,
    Nick
     
  2. macrumors 6502

    Joined:
    Jan 20, 2008
    #2
    You'll have to create a custom subclass of UISlider to achieve this. The general flow would be something like:

    - Create a custom subclass of UISlider
    - Override the touch handling methods
    - When a touch down is detected, determine the location of the touch relative to self
    - Set the value of self (the UISlider) to the value corresponding to that touch location
     

Share This Page