解决UISlider滑块不灵敏
2016-07-15 14:37
369 查看
由于UI给的thumbImage图片过小,默认UISlider开始拖动的手势范围只有thumbImage的大小之内.
为了解决这个问题需要创建一个子类继承于UISlider.重写其中的方法:
为了解决这个问题需要创建一个子类继承于UISlider.重写其中的方法:
- (CGRect)thumbRectForBounds:(CGRect)bounds trackRect:(CGRect)rect value:(float)value{ //y轴方向改变手势范围 rect.origin.y = rect.origin.y - 10; rect.size.height = rect.size.height + 20; return CGRectInset ([super thumbRectForBounds:bounds trackRect:rect value:value], 10 ,10); }
相关文章推荐
- iOS开发从入门到精通--UIButton事件处理
- UITableView ,UICollectionView,视图刷新的时候用
- HDU 4632 Palindrome subsequence (区间DP)
- 将UEditor的图片批量上传抠出来单独使用
- java GUI基础
- 2016.03.31,英语,《Vocabulary Builder》Unit 08
- SoapUI进行REST请求,POST方法提交到数据库的数据乱码问题
- 未找到与约束 ContractName Microsoft.VisualStudio.Text.ITextBufferFactoryService RequiredTypeIdentity Microsoft.VisualStudio.Text.ITextBufferFactoryService
- mui记录
- burpsuite,对web网站进行Intruder攻击
- 自定义UIMenuController
- Request is not available in this context
- AbstractQueuedSynchronized源码探索
- iOS进阶 - UIDynamic
- stringbuffer与stringbuilder的区别
- HDU - 1711 - Number Sequence (KMP)
- EasyUI基本配置,HelloWorld
- iOS UILabel高度自适应
- Android view中的requestLayout和invalidate方法
- 【Debug】The value of ESP was not properly saved across a function call.