-1

I have one label which have a Dynamic string data e.g: "I am Mohit" .I want to make only "am" in bold.Is it Possible in iphone? if yes please give me suggestion.Thanks in advance:)

M.S.B
  • 121
  • 1
  • 9
  • try this link : http://cocoacontrols.com/platforms/ios/controls/rtlabel – hchouhan02 Mar 12 '12 at 09:17
  • possible duplicate of [iPhone - UILabel containing text with multiple fonts at the same time](http://stackoverflow.com/questions/1417346/iphone-uilabel-containing-text-with-multiple-fonts-at-the-same-time) – petert Mar 12 '12 at 09:18
  • try this Thread,...i hope you got ur answer.. http://stackoverflow.com/questions/3586871/bold-non-bold-text-in-a-single-uilabel – Arun Mar 12 '12 at 09:28

5 Answers5

1

No you can't have text with different styles in standard UILabel. What you'll probably need to use is NSAttributedString and some custom solution to display them. Check this question for some possible options.

Community
  • 1
  • 1
Vladimir
  • 167,138
  • 35
  • 380
  • 310
1

Not with UILabel. Suggest 2 labels, or subclass. Many related answers, including this.

Community
  • 1
  • 1
petert
  • 6,552
  • 3
  • 34
  • 45
0

No you can't have text with different styles in standard UILabel. You need to use NSAttributedString and some custom solution to display them. Check this

Community
  • 1
  • 1
Kapil Kumar
  • 104
  • 8
0

done something like this using three20's TTStyledTextLabel :) it works perfectly

janusfidel
  • 7,682
  • 4
  • 27
  • 50
-1

you can use textView instead of label to fulfill your requirement.

ex:-

[textview setContentToHTMLString:@""];

Sirji
  • 554
  • 6
  • 9
  • This method is now deprecated. If you use this method in your app then apple will reject your app. – SJS Oct 10 '12 at 13:07