Created
January 28, 2014 05:21
-
-
Save timothy1ee/8662658 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// adjust the textView width base on screen size and orientation | |
// the only constant width in the cells is the checkbox (64) | |
CGRect screenRect = [[UIScreen mainScreen] bounds]; | |
CGFloat width = [self isPortraitOrientation] ? screenRect.size.width : screenRect.size.height; | |
width -= 64; | |
CGRect textRect = [textView.text boundingRectWithSize:CGSizeMake(width, MAXFLOAT) | |
options:NSStringDrawingUsesLineFragmentOrigin | |
attributes:@{NSFontAttributeName:[UIFont systemFontOfSize:17]} | |
context:nil]; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment