swift UIViewController背景设置withUIImageView显示为灰色叠加

时间:2017-05-06 00:47:41

标签: ios swift uiviewcontroller uiimageview

我正在设置UIViewController背景。当呈现时,背景具有灰色(isch)覆盖。请注意,我没有使用IB完成的应用程序是用纯swift代码实现的

图片:

left:原始存储在Assets.xcassets

右:图像由ViewVontroller

显示

enter image description here

import UIKit

class SignOnVC: UIViewController {

    let background: UIImageView = {
        let image = UIImageView()

        //image sits in Assets.xcassets
        image.image = #imageLiteral(resourceName: "backgroundScreen") 

        return image
    }()

    override func viewDidLoad() {
        super.viewDidLoad()

        self.view.addSubview(background)

        // constraints.....        
    }
}

0 个答案:

没有答案