简体   繁体   English

为iPhone 4s,5、6和6+开发

[英]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. 但是,就iPhone 6和新Xcode的所有这些消息而言,一切都变得令人困惑。 Using Auto layout and designing for the iPhone have just become the most complicated thing to do. 为iPhone使用自动布局和设计已经成为最复杂的事情。 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). 我想要做的就是调整它们的大小,以使其合理地适合所有iPhone平台(纵向)。 For example I would like for certain images to grow as I work From the iPhone 5 to the 6+. 例如,从iPhone 5到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 添加长宽比约束,以便它可以根据获取的宽度自动计算其高度

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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