简体   繁体   中英

Set UISlider's thumb image in storyboard

I realize you can do this in code like:

UIImage *thumbImageNormal = [UIImage imageNamed:@"SliderThumb-Normal"];
[self.slider setThumbImage:thumbImageNormal forState:UIControlStateNormal];

But is there not a way to set in the storyboard? I see the settings for Min and max (image below) but not for the thumb? Am I just missing something obvious here?

在此输入图像描述

The answer would be NO.
"I see the settings for Min and max (image below) but not for the thumb?"

The images you set for Min & max would be supplementary images for your slider. They will appear in left/right of your slider. If you want to customize trackBar, you would change Min & Max tint. Same you can do for Thumb too. You can change tint for all three in IB, but to change thumb image, either write the same code you listed above, or hope that it would be included in next update of XCode & wait till then .. :P
MeanWhile, have a look at this

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM