ios - 替换 UIlabel 代替 UIImageView 而不删除 interfacebuilder 中的约束

标签 ios objective-c uiimageview uilabel ios-autolayout

我有一个xib,其中有一个UIImageView。我已经为 UIImageview 和其他 Labels 设置了约束。现在我想要用 UILabel 代替 UIImageView。 是否可以将 UIImageView 替换为 UILabel 而无需删除 interface builder 中的 contraints

最佳答案

您可以将 UIImageView 和 UILabel 都放在 xib 上,并在需要时切换可见性。

关于ios - 替换 UIlabel 代替 UIImageView 而不删除 interfacebuilder 中的约束,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39181255/

相关文章:

iphone - 如何在 iOS 上获取模板选择器/文档浏览器 View ?

objective-c - 如何将 iPad View 分解为更易于管理的 block ?

ios - UICollectionView:设置新布局和目标内容偏移量

iphone - 在imageview中的图像透明部分着色

iphone - 自定义对象的Dealloc

ios - 单例中使用的字典内存泄漏

iOS:在 segue 中无法同时满足约束

ios - UIImage 到另一个 UIImage

ios - 在AspectFit之后获取UIImage的尺寸或CGRect

ios - 无法让最简单的 cocoapod 库工作