标签和UIFont上的ios 7排版

cdu*_*dub 2 fonts typography uifont ios ios7

我有以下代码:

UILabel *registerLabel = [ [UILabel alloc ] initWithFrame:CGRectMake(20.0, 90.0, [self screenWidth], 43.0) ];
registerLabel.textAlignment =  NSTextAlignmentLeft;
registerLabel.textColor = [UIColor whiteColor];
registerLabel.backgroundColor = [UIColor blackColor];
registerLabel.font = [UIFont fontWithName:@"Helvetica Neue" size:(20.0)];
//registerLabel.adjustsFontSizeToFitWidth = YES;
registerLabel.text = @"Register";
Run Code Online (Sandbox Code Playgroud)

但我在一些ios 7演示应用程序(如日历)中看到字体很大但更薄.我尝试使用Helevetica Neue Light,但这不起作用.有没有办法让字体变薄或使用什么字体?

cdu*_*dub 7

我找到了答案:

registerLabel.font = [UIFont fontWithName:@"HelveticaNeue-Light" size:(36.0)];
Run Code Online (Sandbox Code Playgroud)

.font 是你需要的