简体   繁体   中英

Developing for IPhone 4s, 5, 6 and 6+

I've been working on a specific app for a while now and everything was good. But upon all this news of the iPhone 6 and the new Xcode, everything has just become confusing. Using Auto layout and designing for the iPhone have just become the most complicated thing to do. Every time I add constraints my images just triple in size. When all I want is to resize them to fit rationally across all the iPhone platforms(In portrait mode). For example I would like for certain images to grow as I work From the iPhone 5 to the 6+. Does any one know how to do this?

What do you mean triple in size?

Easiest way to have an image view scale is do the following:

  • Add it as a subview to the view of your view controller
  • Pin it at the top, left and right, leaving height unconstrained
  • Add an aspect ratio constraint, so that it can automatically calculate its height based on the width it gets

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM