标签: uiprogressbar

如何在UIProgressView中设置进度色调颜色

我想知道如何设置UIProgressView色调.有时,根据颜色,默认高度不允许正确查看进度.如何解决这个问题?

xcode uiprogressbar ios

14
推荐指数
3
解决办法
2万
查看次数

将UIProgressBar添加到UITableViewCell

我需要UIProgressBarUITableviewCell播放音频剪辑时显示输入.

我尝试运行a NSTimer然后尝试更新进度视图,但它不起作用.这是我的代码.请让我知道这种方法有什么问题.

运行计时器

self.timer = [NSTimer scheduledTimerWithTimeInterval:0.25
                                          target:self
                                        selector:@selector(updatePlayProgress)
                                        userInfo:nil
                                         repeats:YES];
Run Code Online (Sandbox Code Playgroud)

更新TableviewCell中的UIProgressView

- (void)updatePlayProgress {
    AppDelegate *appDelegate = (AppDelegate *)[[UIApplication sharedApplication] delegate];

    NSLog(@"Duration %f", appDelegate.moviePlayer.duration);
    NSLog(@"Current time %f", appDelegate.moviePlayer.currentPlaybackTime);

    float timeLeft = appDelegate.moviePlayer.currentPlaybackTime/appDelegate.moviePlayer.duration;

    // upate the UIProgress
    NSIndexPath *indexPath = [NSIndexPath indexPathForRow:playingIndex inSection:0];
    FeedCell *cell = (FeedCell*)[self tableView:self.tblView cellForRowAtIndexPath:indexPath];

    NSLog(@"Time left %f", timeLeft);

    cell.progressPlay.progress = 0.5;

    [cell.progressPlay setNeedsDisplay];
}
Run Code Online (Sandbox Code Playgroud)

的cellForRowAtIndexPath

fCell.progressPlay.alpha = 0.5;
fCell.progressPlay.tintColor = navigationBarColor;
[fCell.progressPlay setTransform:CGAffineTransformMakeScale(fCell.frame.size.width, fCell.frame.size.height)];

[fCell.progressPlay setHidden:NO];

return fCell;
Run Code Online (Sandbox Code Playgroud)

输出应该与此类似

在此输入图像描述

objective-c uitableview uiprogressview uiprogressbar ios

11
推荐指数
1
解决办法
360
查看次数

AVPlayer seekToTime:向后不工作

我有以下代码:

AVPlayerItem *currentItem = [AVPlayerItem playerItemWithURL:soundURL];
[self.audioPlayer replaceCurrentItemWithPlayerItem:currentItem];
[self.audioPlayer play];
Run Code Online (Sandbox Code Playgroud)

这里soundURL是一个remoteURL.它工作正常.在AVPlayer完美播放音乐.我有一个进度条,我根据播放器的当前时间更新它.

一切正常.我的问题是当我向前拖动进度条audioplayer从新位置开始但是如果我拖动progressbar它不会从新位置开始实际上它从先前位置恢复.这是我的进度条拖动开始和停止代码:

- (IBAction)progressBarDraggingStart:(id)sender
{
     if (self.audioPlayer.rate != 0.0)
     {
          [self.audioPlayer pause];
     }
}

- (IBAction)progressBarDraggindStop:(id)sender
{
     CMTime newTime = CMTimeMakeWithSeconds(self.progressBar.value, 1);
     [self.audioPlayer seekToTime:newTime];
     [self.audioPlayer play];
}
Run Code Online (Sandbox Code Playgroud)

任何人都可以帮我解决这个问题吗?

objective-c uiprogressbar ios avplayer

7
推荐指数
1
解决办法
4779
查看次数

如何以编程方式快速制作 UIProgressBar

我想以编程方式快速制作 UIProgressBar 吗?

这段代码有什么问题?

 override func viewDidLoad() {
    super.viewDidLoad()
        let progressView = UIProgressView(progressViewStyle: .Bar)
        progressView.center = self.view.center
        progressView.frame = CGRectMake(0,0,50,20)
        progressView.translatesAutoresizingMaskIntoConstraints = false
        progressView.setProgress(0.5, animated: false)
        self.view.addSubview(progressView)
 }
Run Code Online (Sandbox Code Playgroud)

uiviewcontroller uiprogressbar swift

7
推荐指数
1
解决办法
8341
查看次数

如何自定义矩形进度条?

我想用UIKIT定制一个矩形进度条,就像吸引的图像一样.有没有任何源代码?Cocos2d与CCProgressTimer具有相同的功能,但我找不到任何UIKIT源代码. 矩形进度条

objective-c uiprogressview uiprogressbar ios progress-bar

0
推荐指数
1
解决办法
2303
查看次数