bottomLabel
.text =中国語の文字を設定すると、aboveLabel
が表示されず、ビューの階層をデバッグすると何が問題になるのですか?UILabelの上にUILabelを追加するには
UILabel *bottomLabel = [[UILabel alloc]initWithFrame:CGRectMake(0, 100, 200, 40)];
bottomLabel.backgroundColor = [UIColor redColor];
bottomLabel.text = @"中文";
[self.view addSubview:bottomLabel];
UILabel *aboveLabel = [[UILabel alloc]initWithFrame:CGRectMake(0, 0, 60, 30)];
aboveLabel.backgroundColor = [UIColor greenColor];
aboveLabel.text = @"aboveLabel";
[bottomLabel addSubview:aboveLabel];
私はbottomLabel.text = @ "ABC" を設定した場合、それがうまく機能し、私は何を非常にわかりませんあなたはそれをもっと説明できますか? – potato
上記のラベルはボトムラベルのovelapなので、ボトムテキストは表示されません。 – Jay
set bottomLabel.text = @ "abc"、次に実行すると、この2つのlabels.my質問が表示されます。なぜbottomLabel.text = @ "中文"に設定すると、緑のラベルが表示されませんか? – potato