Skip to content

Instantly share code, notes, and snippets.

@fwhenin
Created January 6, 2015 20:27
Show Gist options
  • Save fwhenin/2c2492ec3f6c600a66ac to your computer and use it in GitHub Desktop.
Save fwhenin/2c2492ec3f6c600a66ac to your computer and use it in GitHub Desktop.
Increase the size of the textLabel in UITableViewCellStyle.Value2
override func layoutSubviews() {
super.layoutSubviews();
var offset = CGFloat(20);
var labelWidth = CGFloat(120);
var space = CGFloat(5);
var labelHeight = CGFloat(21);
var cellHeight = CGFloat(44);
var labelTopMargin = (cellHeight - labelHeight)/2;
// change frame of one or more labels
self.textLabel!.frame = CGRectMake(0, labelTopMargin, labelWidth, labelHeight);
self.detailTextLabel!.frame = CGRectMake(labelWidth + space, labelTopMargin, 300-labelWidth-space, labelHeight);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment