0

Is this possible to achieve something like that on iOS simply using UILabel + UIView ?

I've tried using a UIWebView but it's too slow to be used in a UITableView.

That style using UILabel ? http://cl.ly/f9d4f776171e1cb6faaf/content

Pierre Valade
  • 3,388
  • 3
  • 24
  • 29

2 Answers2

0

Something like this

lbl.backgroundColor = [UIColor redColor];
lbl.textColor = [UIColor whiteColor];

Assuming lbl is a UILabel object.

Nyx0uf
  • 4,609
  • 1
  • 25
  • 26
0
lbl.font = [UIFont boldSystemFontOfSize:20];
karim
  • 15,408
  • 7
  • 58
  • 96
  • If you want to make such a text, you need to set it like this, (change text color, back ground color and font size). lbl.backgroundColor = [UIColor redColor]; lbl.textColor = [UIColor whiteColor]; lbl.font = [UIFont boldSystemFontOfSize:20]; IF the string is not of same length, you can set the Font Size in IB to "Adjust to fit", or lbl.adjustsFontSizeToFitWidth = YES OR, you can change the label frame size with string size. You can get the current string length in pixel using NSString.sizeWithFont method in UIKit framework. – karim Aug 12 '10 at 10:27