自定义UISlider外观 [英] Customizing UISlider look

查看:116
本文介绍了自定义UISlider外观的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

要自定义UISlider的视觉外观,您可以设置缩略图和轨道图像。部分轨道图像被拉伸到适当的。从文档:

To customize the visual look of a UISlider you can set the thumb and track images. Part of the track images gets stretched to the appropriate with. From the documentation:


可伸展区域位于两个
端盖区域之间。端盖定义
的图像的部分保持
为原样,不拉伸。
可伸展区域是一个1磅宽的
区域之间的端帽,可以
复制,使图像出现
更长。

A stretchable region sits between two end cap regions. The end caps define the portions of the image that remain as is and are not stretched. The stretchable region is a 1-point wide area between the end caps that can be replicated to make the image appear longer.

现在我的问题是我的可伸展区域需要超过1点宽。 (这是一个模式)不幸的是,1点宽度似乎是硬编码在SDK中。

Now the problem I have is that my stretchable region needs to be more than 1-point wide. (It's a pattern) Unfortunately the 1-point width seems to be hard coded in the SDK.

任何人有想法如何解决这个问题?或者我将从头开始编写自己的滑块吗?

Anyone having an idea how to work around this? Or will I have to write my own slider from scratch for this?

推荐答案

我相信你必须编写自己的滑块来做。似乎没有(公共)API来改变UISlider关于可伸展区域的行为。

I believe you'll have to write your own slider to do that. There seems to be no (public) API to change UISlider's behavior regarding the stretchable region.

这篇关于自定义UISlider外观的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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