Skip to content

Instantly share code, notes, and snippets.

@mike3k
Created January 21, 2011 02:02
Show Gist options
  • Save mike3k/789122 to your computer and use it in GitHub Desktop.
Save mike3k/789122 to your computer and use it in GitHub Desktop.
use sizeOfString to resize a view
CGSize constraint = CGSizeMake(200000.0, 10.0);
CGSize size = [sourceLabel.text sizeWithFont:[UIFont italicSystemFontOfSize:7.0] constrainedToSize:constraint
lineBreakMode:UILineBreakModeTailTruncation];
sourceLabel.frame = CGRectMake(318.0 - size.width,
quantityPickerView.frame.origin.y,
size.width,
size.height);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment