<分区>
我有这段代码,用一些文本和默认字体创建简单的 UILabel
self.reviewCountLabel = [[UILabel alloc] initWithFrame:someFrame];
self.reviewCountLabel.text = @"1231 REVIEWS";
self.reviewCountLabel.textAlignment = NSTextAlignmentRight;
self.reviewCountLabel.backgroundColor = [UIColor lightGrayColor];
// self.reviewCountLabel.font = [UIFont fontWithName:kSTGFontAvantGardeBold size:18];
[self addSubview:self.reviewCountLabel];
在屏幕上我得到这个:
但是如果我取消注释添加自定义字体的代码,我会得到这个:
有人能解释一下为什么我要垂直对齐到顶部吗? (或帮助解决)