Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
UILabelがフレームサイズをUILabelのテキストの長さに調整することは可能ですか?はいの場合、どのように?
ありがとう。
使用-sizeToFit:
-sizeToFit
[label sizeToFit];
さらに、幅に合わせてフォントサイズを調整することもできます。
[label setAdjustsFontSizeToFitWidth:YES]; [label setMinimumFontSize:8.f];