• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Mixed font sizes in a UILabel?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Mixed font sizes in a UILabel?


  • Subject: Re: Mixed font sizes in a UILabel?
  • From: Jon Drukman <email@hidden>
  • Date: Thu, 15 Oct 2009 10:10:09 -0700

On Thu, Oct 15, 2009 at 9:20 AM, Eric E. Dolecki <email@hidden> wrote:

> Thanks Luke. This might be a nice feature request to be able to do this
> easily (and let's say truncation and resizing would not work if implemented
> (I realize the pitfalls)).
>

You might want to check out Joe Hewitt (of Facebook fame)'s library:
Three20.
http://github.com/joehewitt/three20

It supports styled text labels with css among many other features.


NSString* kText = @"\
This is a test of styled labels. Styled labels support \
<b>bold text</b>, <i>italic text</i>, <span class=\"blueText\">colored
text</span>, \
<span class=\"largeText\">font sizes</span>, \
<span class=\"blueBox\">spans with backgrounds</span>, inline images \
<img src=\"bundle://smiley.png\"/>, and <a
href=\"http://www.google.com\";>hyperlinks</a>
you can \
actually touch. URLs are automatically converted into links, like this:
http://www.foo.com\
<div>You can enclose blocks within an HTML div.</div>\
Both line break characters\n\nand HTML line breaks<br/>are respected.";

  TTStyledTextLabel* label1 = [[[TTStyledTextLabel alloc]
initWithFrame:self.view.bounds] autorelease];
  label1.font = [UIFont systemFontOfSize:17];
  label1.text = [TTStyledText textFromXHTML:kText lineBreaks:YES URLs:YES];
  label1.contentInset = UIEdgeInsetsMake(10, 10, 10, 10);
  [label1 sizeToFit];
  [self.view addSubview:label1];



-jsd-
_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

References: 
 >Mixed font sizes in a UILabel? (From: "Eric E. Dolecki" <email@hidden>)
 >Re: Mixed font sizes in a UILabel? (From: Luke the Hiesterman <email@hidden>)
 >Re: Mixed font sizes in a UILabel? (From: "Eric E. Dolecki" <email@hidden>)

  • Prev by Date: Re: shared preferences.
  • Next by Date: How to switch the default printer?
  • Previous by thread: Re: Mixed font sizes in a UILabel?
  • Next by thread: How to switch the default printer?
  • Index(es):
    • Date
    • Thread