問題描述
uitextview 字體不隨 fontWIthName 改變 (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!
‑‑‑‑‑
參考解法
方法 1:
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"