自定义Parse使用背景图像登录(Swift)(Customizing Parse Log in with background image (Swift))

编程入门 行业动态 更新时间:2024-10-10 17:30:43
自定义Parse使用背景图像登录(Swift)(Customizing Parse Log in with background image (Swift))

因为Parse处理Logging In,所以我想坚持使用Parse的默认登录/注册屏幕,我在空白的viewController上显示。

但是,为了更多地定制它,我想在登录/注册文本字段和按钮后面添加(最好是模糊的)背景图像。

我可以通过故事板将模糊图像放在View中,但是如何设置我弹出的logInViewController的背景,以便可以看到背景图像?

或者,如何通过LogInViewController上的调用放置模糊的背景图像? 到目前为止,我还没能完全按照自己的意愿去做。 我下面的代码将图像添加为patternImage,但我希望它能占用整个屏幕的背景。

func showLogInViewController(){

//build logInVC in Code: var logInViewController = PFLogInViewController() var logInLogoTitle = UILabel() logInLogoTitle.text = "Thredz" logInLogoTitle.font = UIFont(name: "Cochin", size: 40.0) logInViewController.fields = PFLogInFields.UsernameAndPassword | PFLogInFields.LogInButton | PFLogInFields.SignUpButton | PFLogInFields.PasswordForgotten | PFLogInFields.Twitter //| PFLogInFields.Facebook logInViewController.logInView?.logo = logInLogoTitle logInViewController.logInView?.backgroundColor = UIColor(patternImage: UIImage(named: "SFStreetcar")!) logInViewController.delegate = self //present log in VC self.presentViewController(logInViewController, animated: true, completion: nil)

Because Parse handles Logging In so well, I want to stick with Parse's default Log In/Sign Up screen which I present over a blank viewController.

However, to customize it more I'd like to add (preferably blurred) background image behind the Log In/Sign up text fields and buttons.

I can place the blurred image in a View via the Storyboard, but how can I set the background of the logInViewController that I pop so the background image is visible?

Alternatively, how could place the blurred background image via a call on LogInViewController? So far I haven't been able to do exactly what I'm trying to do. My code below adds the image as a patternImage, but I want it to take up the entire screen's background.

func showLogInViewController() {

//build logInVC in Code: var logInViewController = PFLogInViewController() var logInLogoTitle = UILabel() logInLogoTitle.text = "Thredz" logInLogoTitle.font = UIFont(name: "Cochin", size: 40.0) logInViewController.fields = PFLogInFields.UsernameAndPassword | PFLogInFields.LogInButton | PFLogInFields.SignUpButton | PFLogInFields.PasswordForgotten | PFLogInFields.Twitter //| PFLogInFields.Facebook logInViewController.logInView?.logo = logInLogoTitle logInViewController.logInView?.backgroundColor = UIColor(patternImage: UIImage(named: "SFStreetcar")!) logInViewController.delegate = self //present log in VC self.presentViewController(logInViewController, animated: true, completion: nil)

最满意答案

找到了解决方案:

logInViewController.logInView?.backgroundColor = UIColor.clearColor() loginViewController.modalPresentationStyle = UIModalPresentationStyle.OverCurrentContext

...导致Parse Log In覆盖在我在故事板中设置的imageView上。

figured out a solution:

logInViewController.logInView?.backgroundColor = UIColor.clearColor() loginViewController.modalPresentationStyle = UIModalPresentationStyle.OverCurrentContext

...results in the Parse Log In being overlayed over the imageView I set up in my storyboard.

更多推荐

本文发布于:2023-07-27 15:20:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1292359.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:自定义   图像   背景   Parse   Swift

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!