06-常用UI控件之 UISlider滑块
2015-07-09 20:37
495 查看
self.slider.maximumValue
=
1;
self.slider.minimumValue
=
0;
self.slider.value
=
0.2;
[self.slider
addTarget:self
action:@selector(action:)
forControlEvents:UIControlEventValueChanged];
- (void)action :(UISlider
*)slide
{
self.img.alpha
= slide.value;
}
常用属性
//
设置滑动条最大值
_slider.maximumValue=1;
//
设置滑动条最小值
_slider.minimumValue=0;
//
添加方法 注意:使用UIControlEventValueChanged
[_slider
addTarget:self
action:@selector(sliderAction:)
forControlEvents:UIControlEventValueChanged];
//
设置当前值
_slider.value=.7;
//
设置滑块按钮右方颜色 maximumValueImage设置右方滑动条图片
_slider.maximumTrackTintColor=[UIColor
yellowColor];
//
设置滑块按钮左方颜色 minimumValueImage设置左方图片
_slider.minimumTrackTintColor=[UIColor
redColor];
//
设置滑块的图片
// _slider setThumbImage:<#(UIImage *)#> forState:<#(UIControlState)#>
相关文章推荐
- 05-常用UI控件之 UIImageView
- 2015年7月9日 UITableView
- 04-常用UI控件之 UIlable UIButton UITextFiled
- 02-UIView 调节控件层次
- Java多线程总结之线程安全队列Queue
- Algorithms—60.Permutation Sequence
- 教你把UIView切成任意形状 通过ShapeLayer
- 循环中标签outer用法:break outer continue outer
- Avoid hardcoding the debug mode; leaving it out allows debug and release builds to automatically a
- iOS使用EGO实现UITableView或UICollectionView横向分页刷新
- 浅谈NGUI的NGUITools类
- N-Queens N皇后放置问题 回溯法
- 配置duilib教程
- UI_UITableView_搭建
- UpMarqueeTextView-模仿淘宝客户端向上滚动的广告条
- (or type control -D to continue)
- For多重循环 break continue
- Set-UID程序漏洞实验
- NGUI奇葩的collider不能触发的问题处理
- /mongod: /usr/lib64/libssl.so.10: no version information available (required by ./mongod)