0

I'm coding a remote control with a background (designed in Photoshop) already for the iPhone 6+ with the proper resolution, which I use with an UIImageView at full size.

I disabled Autolayout/Size Classes and set the size to Inferred. Further I uploaded all relevant LaunchImages for proper scaling.

The UIImageView scales properly for all screen sizes, but the buttons I put over the background are moving.

For example: All buttons (over 1-9, Power Off, Menu ecc.) should always stay at the same position (in releation to the selected device and screen resolution).

I can't get it, that all buttons stay over the designed photoshop elements.

Please give me a good advice, to solve this issue.

Anton K
  • 4,658
  • 2
  • 47
  • 60
iOsNewbie
  • 17
  • 1
  • 1
  • 5

1 Answers1

1

I would recommend using size classes and Autolayout. This type of thing is exactly what they are made for. This youtube video is a great introduction to size classes and some Autolayout: https://www.youtube.com/watch?v=IwSTXY0awng&feature=youtu.be

Anton Gregersen
  • 385
  • 2
  • 7
  • Thanks for your reply. Is there no other way to implement the remote control without autolayout/size-classes? – iOsNewbie Sep 24 '14 at 18:22
  • 1
    As far as i can tell from your description the only way would be to do it by code. Learning autolayout and size classes now will save you much time down the line, it's differently worth it. – Anton Gregersen Sep 24 '14 at 18:25
  • Yes, it seems to, but at the moment I don't see a solution for the remote control. The background is scaling automatically, so how to define the buttons position? – iOsNewbie Sep 24 '14 at 18:35
  • 1
    @iOsNewbie see e.g. http://stackoverflow.com/questions/16422715/ios-autolayout-proportionally-resize-uiviews — you can use autolayout to specify that a view e.g. start 5% in from the left-hand side of an image and then occupy 10% of the room. So they scale proportionally, exactly as the background image will. – Tommy Sep 24 '14 at 19:02