私は自分のUILabelを水平にセンタリングしようとしています。これは、そのように見えるようになる(中心がないことに気付く)。なぜ私のUILabelが中央にないのですか?
ReflectionView *aReflectionView = [[ReflectionView alloc]initWithFrame:CGRectMake(((self.view.bounds.size.width/2) - 150), 40, 300, 90)];
UILabel *aLabel = [[UILabel alloc]initWithFrame:CGRectMake(((self.view.bounds.size.width/2) - 150), 0, 300, 90)];
aLabel.textAlignment = UITextAlignmentCenter;
aLabel.text = @"1 lbs";
self.weightLabel = aLabel;
[aReflectionView addSubview:self.weightLabel];
self.weightReflectionView = aReflectionView;
[self.view addSubview:self.weightReflectionView ];
[self.weightReflectionView updateReflection];
テキストが大きすぎるようです。それを縮小し、確認のためのセンターを取得するかどうかを確認します。 – wbyoung