0

Possible Duplicate:
UILabel text Issue in iphone

I have following text like this, Example: Offers Details: if users checkin from fb will get 20% discount and if share the this offers on twitter will get 30 % discount from businesses.

I above example I want to make 'Offers details' only bold rest of the text I want regular. How I can achieve this, I apply lot efferts to achieve this but not able to get proper solution for this. Please help me to achieve this.

4

1 回答 1

0

在单标签中,如果您希望您可以执行以下操作以使特定标签变为粗体,则不可能代替此。

 UILabel* myBoldlabel= [[UILabel alloc] init];
 myBoldlabel.text=@"Offer Details"; 
 myBoldlabel.font = [UIFont boldSystemFontOfSize:16.0f];
 UILabel* finalLabel=[[UILabel alloc] init];
 finalLabel.text=[NSString stringWithFormat:@"%@:,if users checkin from fb will get 20%  discount and if share the this offers on twitter will get 30 % discount from businesses",myBoldlabel];// You can place %@ anywhere in the sentence...
 finalLabel.numberOfLines=2;

如果你愿意应用任何特定的字体,你也可以这样添加——:

myBoldlabel.font = [UIFont fontWithName:@"TrebuchetMS-Bold" size:18];

希望这对您有所帮助。

于 2012-10-17T10:55:25.153 回答