Centering a view in its superview using Visual Format Language

Currently, no, it doesn’t look like it is possible to center a view in the superview using only VFL. It is, however, not that difficult to do it using a single VFL string and a single extra constraint (per axis): VFL: “|-(>=20)-[view]-(>=20)-|” [NSLayoutConstraint constraintWithItem:view attribute:NSLayoutAttributeCenterX relatedBy:NSLayoutRelationEqual toItem:view.superview attribute:NSLayoutAttributeCenterX multiplier:1.f constant:0.f]; One would think that you … Read more