如何从 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]];
关于ios - UILabel : how do you set the font size?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6294621/