首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >translatesAutoresizingMaskIntoConstraints和IB

translatesAutoresizingMaskIntoConstraints和IB
EN

Stack Overflow用户
提问于 2014-05-05 11:00:42
回答 1查看 1.1K关注 0票数 4

在UIView.h中,您可以阅读以下内容:

代码语言:javascript
复制
/* by default, the autoresizing mask on a view gives rise to constraints 
   that fully determine the view's position.  Any constraints you set on 
   the view are likely to conflict with autoresizing constraints, 
   so you must turn off this property first. IB will turn it off for you.
 */
- (BOOL)translatesAutoresizingMaskIntoConstraints NS_AVAILABLE_IOS(6_0); // Default YES

因此,这意味着当您从xib创建UIView时,translatesAutoresizingMaskIntoConstraints应该设置为NO

但是,当我使用[[UINib nibWithNibName:nibName bundle:[NSBundle mainBundle]] instantiateWithOwner:self options:nil]创建一个xib视图时,translatesAutoresizingMaskIntoConstraints被设置为YES

知道为什么吗?

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2014-09-06 09:49:50

事实证明,这是苹果公司的bug报告中的一个bug。它应该在将来的版本中被修复。

票数 2
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/23470857

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档