ios - 如何使用 iOS 在 Storyboard 上创建 ImageView 中心?

标签 ios storyboard

我正在尝试在 Xcode 7 和 iOS 9 中使用 iOS Storyboard创建通用应用程序。在 Storyboard概念中,我可以看到很多方法(自动布局、自动约束、自适应 UI 等)。我对那些设计方法感到困惑。请给我一个在所有 iPhone 和 iPad 中心显示 ImageView 的解决方案。

最佳答案

很简单..

1.将uiimageview置于中心

然后添加下面的约束

1.center horizo​​ntally to the view && center vertical to the view

2.设置宽高比

见下图。 enter image description here

enter image description here

enter image description here

居中水平,居中垂直,长宽比设置这三个你会得到...

关于ios - 如何使用 iOS 在 Storyboard 上创建 ImageView 中心?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33992048/

相关文章:

ios - PFUser 未解包 - swift

ios - Swift 从 didSet 调用委托(delegate)

javascript - 是否可以在 iOS 上针对微信内置浏览器的用户代理字符串?

ios - 使 UITextView 中的短语可点击

ios - 为什么默认 Storyboard 应用程序有第二个接口(interface)声明

ios - 如何以编程方式将用户名和密码存储在自动填充中?

ios - 'ld : file not found' after changing product name in Xcode

ios - Git 冲突导致 Storyboard 问题

C# WPF TextBlock 可见性在 StoryBoard 之后不会改变

ios - Storyboard中的原型(prototype)单元不创建 UILabel 等