slider = [[UISlider alloc] initWithFrame:CGRectMake(-50, 100, 214, 18)];
//设置未滑动位置背景图片
[slider setMinimumTrackImage:[UIImage imageNamed:@"main_slider_bg_1.png"]];
//设置已滑动位置背景图
[slider setMaximumTrackImage:[UIImage imageNamed:@"main_slider_bg_1.png"]];
//设置滑块图标图片
[slider setThumbImage:[UIImage imageNamed:@"main_slider_btn.png"] forState:UIControlStateNormal];
//设置点击滑块状态图标
[slider setThumbImage:[UIImage imageNamed:@"main_slider_btn.png"] forState:UIControlStateHighlighte
//设置旋转90度
slider.transform = CGAffineTransformMakeRot
//设置起始位置
slider.value=0;
//设置最小数
slider.minimumValue=0.1;
//设置最大数
slider.maximumValue=1.0;
//设置背景颜色
slider.backgroundColor = [UIColor clearColor];
//设置委托事件
[slider addTarget:self action:@selector(aaa) forControlEvents:UIControlEventValueChang
//添加到VIEW
[self.view addSubview:slider];
//定义委托事件
-(void)aaa{
slider.alpha = slider.value;
}