最佳答案
我正在使用 Parse & ParseUI。 我希望我的 PFLoginViewController 子类有一个透明的背景。将来,我想在背景上放一个模糊的视图。
但是..。一旦 PFLoginViewController 的动画输入完成,背景就会变成黑色... ... 而在动画过程中,背景是透明的。
func presentLogin() {
var loginViewController = LoginViewController()
var signupViewController = SignUpViewController()
loginViewController.fields = .UsernameAndPassword | .LogInButton | .PasswordForgotten | .SignUpButton | PFLogInFields.DismissButton
signupViewController.fields = .UsernameAndPassword | .Email | .DismissButton | .SignUpButton
loginViewController.delegate = self
loginViewController.logInView.backgroundColor = UIColor.clearColor()
loginViewController.logInView.opaque = false
signupViewController.delegate = self
loginViewController.signUpController = signupViewController
self.presentViewController(loginViewController, animated: true) { () -> Void in
//
}
}
我的登录控制器使用的子类:
class LoginViewController: PFLogInViewController {
@IBOutlet weak var _nmcLogoLabel: UILabel!
override func viewDidLoad() {
super.viewDidLoad()
// Do any additional setup after loading the view.
let userName = SettingsManager.userName
let password = SettingsManager.password
self.logInView.usernameField.text = userName
self.logInView.passwordField.text = password
NSBundle.mainBundle().loadNibNamed("LoginViewBranding", owner: self, options: nil)[0] as? UIView
self.logInView.logo = _nmcLogoLabel
}
}
我怎样才能使它透明?
将 clearColor 应用到子类中的 backoundColor 没有区别