【发布时间】:2014-01-23 16:22:55
【问题描述】:
我正在尝试在 UISlider 的拇指上方居中放置一个额外的 UIView。为此,我需要拇指图像的宽度。在 iOS6 中,这工作正常。我可以使用:
CGFloat thumbWidth = self.navSlider.currentThumbImage.size.width;
(如本答案所示:How to get the center of the thumb image of UISlider)
这在 iOS7 中返回 0.0f。我也尝试过使用:
UIImage *thumb = [self.navSlider thumbImageForState:UIControlStateNormal];
但拇指最终为零。
是否可以读取默认滑块缩略图的大小?还是我必须找到它,设置一个常量,Apple 以后如何不更改它?
【问题讨论】: