title: UISlider custom images and thumb height?
body: <p>I am creating (or attempting to) a custom UISlider look, still horizontal but much taller.  I have two problems.</p>
  
  <p>1.This is the code I'm using to get the images onto the slider.</p>
  
  <pre><code>UIImage *minImage = [UIImage imageNamed:@"sliderMin.png"];
  UIImage *maxImage = [UIImage imageNamed:@"sliderMax.png"];
  UIImage *thumbImage = [UIImage imageNamed:@"sliderThumb.png"];
  
  minImage = [minImage stretchableImageWithLeftCapWidth:33.0 topCapHeight:0.0];
  maxImage = [maxImage stretchableImageWithLeftCapWidth:33.0 topCapHeight:0.0];
  // thumbImage = [minImage stretchableImageWithLeftCapWidth:10.0 topCapHeight:0.0];
  
  [_contrastSlider setMinimumTrackImage:minImage forState:UIControlStateNormal];
  [_contrastSlider setMaximumTrackImage:maxImage forState:UIControlStateNormal];
  [_contrastSlider setThumbImage:thumbImage forState:UIControlStateNormal];
  
  minImage = nil;
  maxImage = nil;
  thumbImage = nil;
  
  [_contrastSlider setMinimumValue:0.0];
  [_contrastSlider setMaximumValue:100.00];
  [_contrastSlider setValue:25.0];
  </code></pre>
  
  <p>I have three images, min, max and thumb.  These are the images and how they look on the device, which isn't correct.</p>
  
  <p>I can't post images yet, so here is a <a href="https://skydrive.live.com/redir.aspx?cid=d96ee0343f940893&amp;resid=D96EE0343F940893!539&amp;parid=D96EE0343F940893!116&amp;authkey=!APJHr8MTWDVYHdU" rel="nofollow">link to <code>MYSlider.jpeg</code></a> which shows the components.</p>
  
  <p>The slider should be cream to the right of the thumb, pink to the left.  But this isn't happening.</p>
  
  <p>That's problem 1.  Problem 2 is the thumb size default is too small.  I'm using this :<a href="http://mpatric.blogspot.co.uk/2009/04/more-responsive-sliders-on-iphone.html" rel="nofollow">UISlider Height Hack</a> to try to increase the height of the thumb, but sadly it's making it wider not taller.  So I am asking for help to make the area taller, not wider, and wondering why my pink image is being ignored?</p>
  
  <p>Thank you for any help.</p>
  
  <p>If it helps, here is my UISlider subclass .m:</p>
  
  <pre><code>-(BOOL) pointInside:(CGPoint)point withEvent:(UIEvent*)event {
  CGRect bounds = self.bounds;
  bounds = CGRectInset(bounds, -10, -8);
  return CGRectContainsPoint(bounds, point);
  </code></pre>
  
  <p>}</p>
  
  <pre><code>-(BOOL) beginTrackingWithTouch:(UITouch *)touch withEvent:(UIEvent *)event {
    CGRect bounds = self.bounds;
    float thumbPercent = (self.value - self.minimumValue) / (self.maximumValue - self.minimumValue);
    float thumbPos = THUMB_SIZE + (thumbPercent * (bounds.size.width - (2 * THUMB_SIZE)));
    CGPoint touchPoint = [touch locationInView:self];
    return (touchPoint.x &gt;= (thumbPos - EFFECTIVE_THUMB_SIZE) &amp;&amp; touchPoint.x &lt;= (thumbPos + EFFECTIVE_THUMB_SIZE));
  }
  </code></pre>
  
  <p>Thank you.</p>