1. Abizer Nasir
  2. AutolayoutExample

Commits

Abizer Nasir  committed a761a87

Align text in the centre of the label

  • Participants
  • Parent commits d03ded1
  • Branches master

Comments (0)

Files changed (1)

File AutolayoutExample/ViewController.m

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