简体   繁体   中英

uitextview font not changing with fontWIthName

I'm trying to change the font for a UITextView with textview.font = [UIFont fontWithName:etc]; But for some reason it isn't doing anything and it always displays the same font and size. Here's the code:

UITextView *descriptionTextView = [[UITextView alloc] initWithFrame:rect];
descriptionTextView.editable = NO;
descriptionTextView.scrollEnabled = NO;
descriptionTextView.text = description;
titleTextView.font = [UIFont fontWithName:@"Veranda" size:17.0]; //<- this line isn't working
[cell.contentView addSubview:descriptionTextView];

Any idea what the probem might be?

Thanks a bunch!

May be the error in that you change font of other text field? You operate with textview named 'descriptionTextView', but change font of 'titleTextView'

Or that default font is named "Verdana", not "Veranda"

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM