Reputation: 21
I am having a problem with some code not displaying properly on iPhone X, I've tested on all other devices and it works the way it should but won't work display properly on the iPhone X
coinRect.path = UIBezierPath(roundedRect: CGRect(x: -60, y: -20, width: 120, height: 40), cornerRadius: 5).cgPath
coinRect.position = CGPoint(x: frame.maxX - 70, y: size.height / 2 - ((ceil?.size.height)! + 40))
I have included some screenshots to show the problem I'm having...
iPhone X rectangle is off screen:
iPhone 7 displays as expected:
Upvotes: 2
Views: 224
Reputation: 3051
You are probably running afoul of the scene not having the proper scaleMode assigned. What scaleMode are you using, and how are you assigning the positioning of your screen elements relative to the scene and device size?
Another possibility is that the SKView is larger than the window; have you ensured that it has the proper constraints to peg the SKView to the size of the window?
Upvotes: 1