Note that there are some explanatory texts on larger screens.

plurals
  1. POSetting UILabel - Font through code - generates error - iPhone
    text
    copied!<p>See following code carefully. Because it works perfectly. Try to add in your application. it will work</p> <pre><code>- (void)viewDidLoad { [super viewDidLoad]; // title label - tip UILabel *tmp=[[UILabel alloc] initWithFrame:CGRectMake(50, 50, 200, 200)]; tmp.textColor=[UIColor colorWithRed:(14.0/255.0) green:(105.0/255) blue:(128.0/255) alpha:1.0]; [tmp setFont:[UIFont fontWithName:@"Arial" size:18]]; tmp.text=@"sagar"; tmp.backgroundColor=[UIColor clearColor]; [self.view addSubview:tmp]; [tmp release]; } </code></pre> <p>Now, see following code carefully. Because it doesn't work. See there is nothing difference between both of these code.</p> <pre><code>- (void)viewDidLoad { [super viewDidLoad]; // title label - tip UILabel *tmp=[[UILabel alloc] initWithFrame:CGRectMake(50, 50, 200, 200)]; tmp.textColor=[UIColor colorWithRed:(14.0/255.0) green:(105.0/255) blue:(128.0/255) alpha:1.0]; [tmp setFont:[UIFont fontWithName:@"Arial Black" size:18]]; tmp.text=@"sagar"; tmp.backgroundColor=[UIColor clearColor]; [self.view addSubview:tmp]; [tmp release]; } </code></pre> <p>I have just mentioned #Arial Black# instead #Arial# .</p> <ul> <li>However it isn't working.</li> <li>Is it because of iPhone doesn't support =Arial Black= ?</li> </ul> <p>I would like to know why it isn't working.</p> <p>How many different kind of font does iPhone support?</p> <p>Is there any list?</p> <p>How to set a font name to a UILabel or to any control ? (font which has space within there name )</p> <p>Thanks in advance for sharing your knowledge with me.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload