大きい方と小さい方の 2 つのラベルがちょうど画面の中央に配置されていると思います。座標を変更しても、配置される場所には影響がないようです。なんで?
理想的には、画面のほぼ全体をカバーするように、同じサイズで重ならないようにし、上下に並べる必要があります。
ラベルフレームはフォーマットを使用していると思いました-開始座標、サイズ。私の出身地はどこですか?画面左上ですか?xcodeで翻訳できますか?
#import "ViewController.h"
@interface ViewController ()
@property (nonatomic, strong) UILabel *label;
@property (nonatomic, strong) UILabel *label1;
@end
@implementation ViewController
- (void)viewDidLoad{
[super viewDidLoad];
self.view.backgroundColor = [UIColor whiteColor];
CGRect labelFrame = CGRectMake(-200.0f,0.0f, 200.0f, 200.0f);
self.label = [[UILabel alloc] initWithFrame:labelFrame];
//self.label.adjustsFontSizeToFitWidth = YES;
self.label.text = @"One two three four five six seven eight nine.";
self.label.font = [UIFont boldSystemFontOfSize:28.0f];
self.label.numberOfLines = 5;
self.label.center = self.view.center;
[self.view addSubview:self.label];
CGRect labelFrame1 = CGRectMake(600.0f,600.0f, 100.0f, 100.0f);
self.label1 = [[UILabel alloc] initWithFrame:labelFrame1];
self.label1.text = @"One 1 two three four five six seven eight nine.";
self.label1.font = [UIFont boldSystemFontOfSize:18.0f];
self.label1.numberOfLines = 0;
self.label1.center = self.view.center;
[self.view addSubview:self.label1];
}
@end