博客> iOS - 自定义滑动条
iOS - 自定义滑动条
2018-07-19 03:20 评论:0 阅读:735 OS_JJ
ios 自定义滑动条

 0526EC9ADAE466F2096204D9BDC4EA58.jpg

self.slider = [[UISlider alloc] init]; _slider.minimumValue = 0.0;//下限 _slider.maximumValue = self.videoTime;;//上限 _slider.continuous = YES; [self.view addSubview:_slider]; [_slider makeConstraints:^(MASConstraintMaker *make) { make.bottom.equalTo(_avPlayer.bottom).offset(-10); make.left.equalTo(_avPlayer.left).offset(14); make.width.equalTo(WIDTH-28); make.height.equalTo(10); }]; [_slider addTarget:self action:@selector(sliderValueChanged:) forControlEvents:UIControlEventValueChanged]; _slider.thumbTintColor = HEXCOLOR(0xf7d721); _slider.maximumTrackTintColor = HEXCOLOR(0xffffff); _slider.minimumTrackTintColor = HEXCOLOR(0xf7d721); [_slider setThumbImage:[UIImage imageNamed:@"WechatIMG909"] forState:UIControlStateNormal]; [_slider setThumbImage:[UIImage imageNamed:@"WechatIMG909"] forState:UIControlStateHighlighted];

收藏
0
sina weixin mail 回到顶部