0

In my application i have a text view with a large content which shows some help tips for the user.In that text view i have to make bold some titles.can i set it in my interface builder?anyone have idea?is it possible with any other uiobjects like uilabel or something?I tried with an image view but it is not clear.

iOS Developer
  • 1,723
  • 2
  • 16
  • 47

2 Answers2

0

Since you are using the text view to show help tips I assume it is non editable. If you want richer formatting in this case then I think UIWebView offers better solution, as it supports entire HTML markup. So you can use bold, italics and pretty much everything that CSS offers.

Pritam Barhate
  • 765
  • 7
  • 22
0

I think you are looking for UIFont. You can set the font property or text, and assign it to your label/textview/etc.. with the setFont property.

UIFont* boldFont = [UIFont boldSystemFontOfSize:[UIFont systemFontSize]];
UIFont* italicFont = [UIFont italicSystemFontOfSize:[UIFont systemFontSize]];

Please read through the Documentation of UIFont !


Note: UITextView allows only a single uniform font for all text. If you want different font size I would suggest that you create separate UILabel and UITextView and add them as subviews to your self.view, and align them perfectly. This should solve the problem. But if you want to use only one object for this operation, I would suggest UIWebView, or CoreText or may be CATextLayer's NSAttributedString.

Legolas
  • 12,145
  • 12
  • 79
  • 132