I am getting a title in HTML format as
<p><span style="color: #000000;"><strong>Example </strong></span></p>
I need to show this HTML string in a UILabel. The color code and the font size should be same as the coming in HTML. When I am converting the HTML string into a NSString, only the text "Example" is coming, and not the color.
Is there any solution?
Thnx in advance
Till now I am trying by using a NSAttributedString in following way but by this way the whole HTML is printing:
UIFont *font = [UIFont systemFontOfSize:14.0]; UIFont *secondFont = [UIFont systemFontOfSize:10.0]; NSMutableDictionary *firstAttributes; NSMutableDictionary *secondAttributes; NSDictionary *firstAttributeFont = @{NSFontAttributeName:font}; NSDictionary *secondAttributeFont = @{NSFontAttributeName:secondFont}; [firstAttributes addEntriesFromDictionary:firstAttributeFont]; [secondAttributes addEntriesFromDictionary:secondAttributeFont]; [firstAttributes addEntriesFromDictionary:@{NSForegroundColorAttributeName:[UIColor clearColor]}]; [secondAttributes addEntriesFromDictionary:@{NSForegroundColorAttributeName:[UIColor clearColor]}]; NSString* completeString = [NSString stringWithFormat:@"%@",strTitle]; NSMutableAttributedString *attributedString = [[NSMutableAttributedString alloc] initWithString:completeString]; [attributedString setAttributes:firstAttributes range:[completeString rangeOfString:strTitle]]; // [attributedString setAttributes:secondAttributes range:[completeString rangeOfString:self.secondAttributeText]]; Cell.lbl_Title.attributedText = attributedString;