UISlider

    _videoSlider = [[UISlider alloc] initWithFrame:

                    CGRectMake(10, 0, 200, 31)];

    [_videoSlider addTarget:self action:@selector(videoSlierChangeValue:)

           forControlEvents:UIControlEventValueChanged];

    [_videoSlider addTarget:self action:@selector(videoSlierChangeValueEnd:)

           forControlEvents:UIControlEventTouchUpInside];

    [topView addSubview:_videoSlider];

 

 

    self.videoSlider.maximumValue = CMTimeGetSeconds(duration);

 

    UIGraphicsBeginImageContextWithOptions((CGSize){ 1, 1 }, NO, 0.0f);

    UIImage *transparentImage = UIGraphicsGetImageFromCurrentImageContext();

    UIGraphicsEndImageContext();

    

    [self.videoSlider setMinimumTrackImage:transparentImage forState:UIControlStateNormal];

    [self.videoSlider setMaximumTrackImage:transparentImage forState:UIControlStateNormal];

posted @ 2015-02-28 17:04  lee4519  阅读(177)  评论(0编辑  收藏  举报