如何从 UILabel
设置字体大小?
我的代码:
UILabel *myView = [[UILabel alloc] initWithFrame:RectFrame];
[myView setBackgroundColor:[UIColor blueColor]];
[myView setText:[NSString stringWithFormat:@" A"]];
[myView setFont:[12] ]; <--- Error
[self.view addSubview:myView];
最佳答案
[myView setFont:[UIFont systemFontOfSize:12]];
或
[myView setFont:[UIFont boldSystemFontOfSize:12]];
或用于字体系列
[myView setFont:[UIFont fontWithName:@"Helvetica" size:12]];
https://stackoverflow.com/questions/6294621/
相关文章:
iphone - 改变 setContentOffset 的速度 :animated:?
objective-c - "Couldn' t 编译连接 :"error mean? 是什么意思
ios - 为什么 UICollectionView 的 UICollectionViewCell
ios - 显示 UIAlertController 的简单 App Delegate 方法(在 S
objective-c - 如何在 "for (id item in items)" objecti
objective-c - 是否可以将 NSInteger 转换为 NSNumber?