How would you animate across multiple iPhone Screens? Let me explain a bit.
So, currently I had an animation where three buttons spread out with a spring animation. I already set auto layout and the whole project had no errors or risks.
In my case, which is terrible, I used CGPoint So, it would be like...
animationCodeMethod {
button1.center = CGPoint(x: , y: )
button2.center = CGPoint(x: , y: )
button3.center = CGPoint(x: , y: )
}
My goal of the animation was for three buttons that appeared stacked on each other, to slide out a couple pixels away from each other when executed.
o //Three stacked
executed: ->o-o-o
I know the CGPoint method is terrible.
What works on one device like the iPhone 5, looks completely different on iPhone 6 or 6 plus. I know I'm supposed to use auto layout in code, but literally have no clue. How would you set it up so the animation works across all screens? The CGPoint is very pixel specific. So though it looks okay on one screen size, on another, the resolution changes (more pixels) which makes a different result.
Any help would be very much appreciated.
Aucun commentaire:
Enregistrer un commentaire