gpt4 book ai didi

ios - 为什么自定义字体会移动文本(更改垂直对齐方式)?

转载 作者:行者123 更新时间:2023-11-29 13:17:03 25 4
gpt4 key购买 nike

<分区>

我有这段代码,用一些文本和默认字体创建简单的 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];

在屏幕上我得到这个:

enter image description here

但是如果我取消注释添加自定义字体的代码,我会得到这个:

enter image description here

有人能解释一下为什么我要垂直对齐到顶部吗? (或帮助解决)

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com