How to make UISlider's “track” invisible?

前端 未结 8 643
感动是毒
感动是毒 2021-02-05 07:44

I\'m trying to emulate Apple\'s \"Slide to Unlock\" feature in my application. I get to this point (image below), but as you can see the UISlider\'s \"track\" is visible and is

8条回答
  •  挽巷
    挽巷 (楼主)
    2021-02-05 08:17

    here's an even easier way. No need to create images, just instantiate an empty UIImage class :P

    UIImage *clearImage = [[UIImage alloc] init];
    [self.slider setMinimumTrackImage:clearImage forState:UIControlStateNormal];
    [self.slider setMaximumTrackImage:clearImage forState:UIControlStateNormal];
    

提交回复
热议问题