以下のコードをよくお読みください。それは完璧に働くからです。アプリケーションを追加してみてください。それは動作しますUILabelの設定 - コードによるフォント - エラーが発生する - iPhone
- (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]]; [email protected]"sagar";
tmp.backgroundColor=[UIColor clearColor]; [self.view addSubview:tmp]; [tmp release];
}
今、以下のコードを慎重に参照してください。それは動作しないためです。これらのコードの間には何も違いはありません。
- (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]]; [email protected]"sagar";
tmp.backgroundColor=[UIColor clearColor]; [self.view addSubview:tmp]; [tmp release];
}
私はちょうど#Arial#の代わりに#Arial Black#を述べました。
- ただし、動作しません。
- iPhoneは= Arial Black =をサポートしていないためですか?
私はなぜそれが動作していないのか知りたいです。
iPhoneはどのくらいの種類のフォントをサポートしていますか?
リストはありますか?
フォント名をUILabelまたは任意のコントロールに設定するにはどうすればよいですか? (名前の中にスペースがあるフォント)
私にあなたの知識を共有してくれてありがとうございます。