ios - 如何在 XCode 6 中对齐标签垂直居中

标签 ios swift xcode6

每当我对 UILabel 的高度和宽度添加约束时,文本就会跳到 Controller 的顶部。

如何垂直在 ViewController 中将 UILabel 居中? Image of contstraints

enter image description here

最佳答案

单击 IB 底部工具栏上的“对齐”按钮,然后选择“水平居中”或“垂直居中”。首先,如果你想保持大小,你可能还想固定宽度和高度。

enter image description here

关于ios - 如何在 XCode 6 中对齐标签垂直居中,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25128788/

相关文章:

ios - 使用 SwiftUI 从 Wireframe 创建一个新的 VIPER 模块

ios - 如何检查附近是否有使用相同程序的另一部 iPhone?

ios - 如何保存到 Firebase - Swift

swift - 将 if 子句转换为可选值

ios - 获取应用内购买的订阅到期日期 - 从 appStoreReceiptURL 开始

ios - 如何从不同的 ViewController 执行 collectionView 类

core-data - NSPersistentDocument + StoryBoards : not mixed properly for me

ios - 设置按钮类型

swift - NSFetchRequest 按日期

ios - 'subscript' 的模糊使用 - ios 9 Swift 2.0