Question

created a music player and my tracking progress is uislider with thumb as iTunes . everything seems good except the touch of the slider thumb is not smoothly as iTunes. in iTunes music player the thumb is get touch easily although the dash (thumb image) is too small.

enter image description here

how can I do like iTunes ? can I wide the thumb touch space. I added transparent area in thumb hight but nothing change.

I want the dragging be smoothly , now it needs to tap the thumb and then dragging. plz , I lost a long time try to improve it as iTunes

this is my code for creation the slider

   progressView = [[UISlider  alloc] initWithFrame:CGRectMake(60, 30, 200, 7)];
    [progressView addTarget:self action:@selector(sliderMoved:) forControlEvents:UIControlEventValueChanged];
 [progressView setThumbImage:[UIImage imageNamed:@"thumb.png"] forState:UIControlStateNormal];
 progressView.continuous=YES;
 [self.view addSubview:progressView];



- (IBAction)sliderMoved:(UISlider *)aSlider{
 if (streamer.duration)
    {

        double newSeekTime = (aSlider.value) * streamer.duration;
    [streamer seekToTime:newSeekTime];

    }

}

Was it helpful?

Solution

this article provide the solution by increasing the thumb clickable area

http://mpatric.blogspot.com/2009/04/more-responsive-sliders-on-iphone.html

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top