Swift-UIProgressView对角填充 [英] Swift - UIProgressView fills diagonally

查看:148
本文介绍了Swift-UIProgressView对角填充的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

因此,我将UIProgressView设置为在3秒钟后填充,并稍微增加了条形图的高度.但是,当它填充时,它是对角填充的,而不是仅从一侧填充到另一侧.该栏从右上角开始,然后展开以填充进度视图,直到它即将结束.

So I set up a UIProgressView to fill after 3 seconds as well as increasing the height of the bar a bit. However when it fills up, it fills diagonally as opposed to just filling from one side to the other. The bar starts in the top right corner and then expands to fill the progress view just before it ends.

这是我正在使用的代码:

This is the code I am using:

import UIKit

class LoadingScreen: UIViewController {


    @IBOutlet weak var progressView: UIProgressView!


    override func viewDidLoad() {
        super.viewDidLoad()

        UIView.animateWithDuration(3, animations: { () -> Void in
            self.progressView.setProgress(1.0, animated: true)
        })

        progressView.transform = CGAffineTransformScale(progressView.transform, 1, 10)

}


}

以下是一些屏幕截图:

推荐答案

来得很晚,但我刚刚经历了这一点,并通过将progressView样式更改为.Bar进行了修复.希望有帮助!

Coming to this rather late but I just experienced this and fixed it by changing my progressView style to .Bar. Hope that helps!

let progressView = UIProgressView(progressViewStyle: .Bar)

这篇关于Swift-UIProgressView对角填充的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆