问题描述
因此,出于自定义目的,我将FUIAuthPickerViewController
细分为子类,但无法显示背景.在将Firebase Pod更新到最新版本(在先前版本上运行良好)之后,这种情况开始发生.
So, I subclassed FUIAuthPickerViewController
for customization purposes but I can't get the background to display. This started happening after updating Firebase pods to the latest version (was working fine on the previous version).
这是我当前的设置.
我怎么称呼它(来自AppDelegate
):
How I call it (from AppDelegate
):
var authViewController = authUI.authViewController()
self.window!.rootViewController = authViewController
self.window!.makeKeyAndVisible()
我的FUIAuth的委托方法(也在AppDelegate
中):
My FUIAuth's delegate method (also in AppDelegate
):
func authPickerViewController(forAuthUI authUI: FUIAuth) -> FUIAuthPickerViewController {
return AuthViewController(authUI: authUI)
}
我的子类:
class AuthViewController: FUIAuthPickerViewController {
var imgView: UIImageView!
override func viewDidLoad() {
super.viewDidLoad()
let backgroundImage = #imageLiteral(resourceName: "MainBackground")
imgView = UIImageView(image: backgroundImage)
imgView.contentMode = .scaleAspectFill
self.view.insertSubview(imgView, at: 0)
}
override func viewDidLayoutSubviews() {
super.viewDidLayoutSubviews()
imgView.frame = self.view.bounds
}
}
它是什么样的:
如果我将上面的行从以下位置更改:
If I change the line above from:
self.view.insertSubview(imgView, at: 0)
到
self.view.insertSubview(imgView, at: 1)
然后我可以看到背景而不是按钮:
Then I can see the background and not the buttons:
我的豆荚:
我在这里想念什么?
推荐答案
请参见评论解决方法GitHub问题.
这篇关于无法获得背景显示在子类FUIAuthPickerViewController上的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!