0

Our requirement is to show some text bold and some text as normal style in a label.

e.g. ABC 002
(there is not space between ABC and 002)

There are lots of instances of such labels on a single view, so using UIWebView is not preferred.

Is it possible using the UILabel? If no, then what are the alternatives?

Srikar Appalaraju
  • 71,928
  • 54
  • 216
  • 264
Ramesh Soni
  • 15,867
  • 28
  • 93
  • 113

3 Answers3

1

Using normal UILabel dont think this is possible.

Check out this replacement for UILabel TTTAttributedLabel.

Another way is to use a CATextLayer with an NSAttributedString ! much lighter and simpler than 2 UILabels. (iOS 3.2 and above) as suggested here - Bold & Non-Bold Text In A Single UILabel?

Another way is to use 2 UILabels and position them correctly relative to each other Check out this topic from a previous Stack Overflow.

Community
  • 1
  • 1
Srikar Appalaraju
  • 71,928
  • 54
  • 216
  • 264
1

For making the such labels you might have to use TTStyledTextLabel of Three20 libraries, which allows different styles on the same object of text.

Manish Agrawal
  • 10,958
  • 6
  • 44
  • 76
1

you can achieve that requirement using TTStyledTextLabel of three20 library

janusfidel
  • 8,036
  • 4
  • 30
  • 53