iOS滑块的默认缩略图的大小? [英] Size of default thumb image for iOS slider?

查看:64
本文介绍了iOS滑块的默认缩略图的大小?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

iOS滑块(默认)拇指图像的确切大小(宽度,高度)是多少?

What is the exact size (width, height) of the (default) thumb image for the iOS slider? Is there perhaps some clever way to coax this out of the system (XCode, iOS)?

我尝试过

int thumbWidth = slider.currentThumbImage.size.width;

我发现在此网站上获取缩略图的中心,但返回值为0。

which I found here on this site, but it comes back with 0.

其他问题:Xcode调试器在 UISlider 中显示此未记录的变量: CGFloat _hitOffset 。有人偶然知道它的含义和用途吗?

Additional question: The Xcode debugger shows this undocumented variable in the UISlider: CGFloat _hitOffset. Does anyone by chance know what it is and what it's for?

推荐答案

这怎么办?为我工作:

CGRect trackRect = [self trackRectForBounds:self.bounds];
CGRect thumbRect = [self thumbRectForBounds:self.bounds trackRect:trackRect value:0];
CGSize thumbSize = thumbRect.size;

这篇关于iOS滑块的默认缩略图的大小?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆