Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Parallax effect and menu background #34

Open
lifeisfoo opened this issue Dec 23, 2015 · 0 comments
Open

Parallax effect and menu background #34

lifeisfoo opened this issue Dec 23, 2015 · 0 comments

Comments

@lifeisfoo
Copy link

When I tilt the phone horizontally, a blank background appear on the left (or on the right if I tilt it in the opposite direction). Obviously, if I disable the parallax effect (and the horizontal bounces) this behaviour disappear.

Here is an example:
img_6372_github

The gradient background is declared inside the viewDidLoad method of the menu controller:

        self.view.backgroundColor = UIColor.greenColor()
        gradientLayer.frame = self.view.bounds

        let color1 = UIColor.yellowColor().CGColor as CGColorRef
        let color2 = UIColor(red: 1.0, green: 0, blue: 0, alpha: 1.0).CGColor as CGColorRef
        let color3 = UIColor.clearColor().CGColor as CGColorRef
        let color4 = UIColor(white: 0.0, alpha: 0.7).CGColor as CGColorRef
        gradientLayer.colors = [color1, color2, color3, color4]
        gradientLayer.locations = [0.0, 0.25, 0.75, 1.0]

        self.view.layer.insertSublayer(gradientLayer, atIndex: 0)

Do you have any hint for this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant