删除特定对象自动布局限制 [英] Remove Auto-Layout Constraints for Specific Object

查看:132
本文介绍了删除特定对象自动布局限制的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有嵌入在一个UIView一个UIImageView。我的整个应用程序使用自动布局,但我要删除约束条件的UIImageView。 X $ C $ç不会让我删除的约束,有没有方法来禁用这些特定对象,将它们设为零,什么?

I have a UIImageView embedded in a UIView. My entire app uses Auto-Layout, but I want to remove constraints for the UIImageView. Xcode will not allow me to delete the constrains, is there a way to disable them for a specific object, set them to zero, something?

推荐答案

我同意X code自动布局是可怕的,如果你想要的东西,特别是使用...

I agree Xcode auto-layout is horrible to use if you want something particular...

我用的以编程方式删除约束:

What I use to remove constraints programatically:

[detailsPhotoView removeConstraints:detailsPhotoView.constraints];

这篇关于删除特定对象自动布局限制的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆