Commits

Abizer Nasir committed a761a87

Align text in the centre of the label

Comments (0)

Files changed (1)

AutolayoutExample/ViewController.m

     UILabel *label = [[UILabel alloc] initWithFrame:CGRectZero];
     label.translatesAutoresizingMaskIntoConstraints = NO;
     label.text = @"Example Text";
+    label.textAlignment = NSTextAlignmentCenter;
 
     label.backgroundColor = [UIColor yellowColor];