简体   繁体   English

在故事板中设置UISlider的拇指图像

[英]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? 我看到Min和max的设置(下图)但拇指没有? 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?" “我看到Min和max的设置(下图)但拇指没有?”

The images you set for Min & max would be supplementary images for your slider. 您为Min和max设置的图像将是滑块的补充图像。 They will appear in left/right of your slider. 它们将出现在滑块的左/右。 If you want to customize trackBar, you would change Min & Max tint. 如果要自定义trackBar,则可以更改Min&Max色调。 Same you can do for Thumb too. 你也可以为Thumb做同样的事情。 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 您可以更改IB中所有三个的色调,但是要更改拇指图像,要么编写上面列出的相同代码,要么希望它将包含在XCode的下一次更新中并等到那时..:P
MeanWhile, have a look at this MeanWhile,看看这个

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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