Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- - (void)viewDidLoad
- {
- [super viewDidLoad];
- NSMutableParagraphStyle *paragraphStyle = [[NSMutableParagraphStyle alloc] init];
- paragraphStyle.lineHeightMultiple = 50.f;
- paragraphStyle.lineSpacing = 100.f;
- paragraphStyle.minimumLineHeight = 200.f;
- paragraphStyle.maximumLineHeight = 500.f;
- UIFont *font = [UIFont fontWithName:@"AmericanTypewriter" size:24.f];
- self.textView.attributedText = [[NSAttributedString alloc] initWithString:
- @"This is a test.n Will I pass?" attributes:
- @{NSParagraphStyleAttributeName : paragraphStyle, NSFontAttributeName : font}];
- }
- NSMutableParagraphStyle *paragraphStyle = [[NSMutableParagraphStyle alloc] init];
- paragraphStyle.minimumLineHeight = 35.f;
- paragraphStyle.maximumLineHeight = 35.f;
- UIFont *font = [UIFont fontWithName:@"AmericanTypewriter" size:18.f];
- NSString *string = @"This is a test.nWill I pass?n日本語のもじもあるEnglishnEnglish y Español";
- NSDictionary *attributtes = @{
- NSParagraphStyleAttributeName : paragraphStyle,
- };
- self.textView.font = font;
- self.textView.attributedText = [[NSAttributedString alloc] initWithString:string
- attributes:attributtes];
Add Comment
Please, Sign In to add comment