Domanda

In UIView.h you can read the following:

/* 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

So it means that when you create a UIView from a xib, translatesAutoresizingMaskIntoConstraints should be set to NO.

However, when I create a view form a xib using [[UINib nibWithNibName:nibName bundle:[NSBundle mainBundle]] instantiateWithOwner:self options:nil], translatesAutoresizingMaskIntoConstraints is set to YES.

Any idea why?

È stato utile?

Soluzione

It turns out to be a bug already filed in Apple's bug reporter. It should be fixed in a future release.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top