2

UILabel画面上でそれぞれが上下に複数ある画面を作成しています。ラベルの1つには複数の行があり、ワードラップを有効にするため[myLabel sizeToFit]に一緒に使用myLabel.numberOfLines = 0し、ラベルはすべてのテキストに合うように高さを伸ばすことができます。これは完全に機能しUILabelsますが、Interface Builderでこの複数行のラベルの下に配置した他のすべてのラベルは、それに対する位置を調整しません。UILabel引き伸ばされた複数行のラベルに対して他のオブジェクトの位置を自動的に調整する方法はありますか?

ありがとう

ブライアン

4

2 に答える 2

1

見回すと、最善の解決策は、これを静的セルを使用したUITableViewとして実際に実装することです。

于 2012-03-29T23:42:13.710 に答える
0

I'd love to be proven wrong, but I think the only way to achieve this is to subclass the parent view of those UILabels and override layoutSubviews method. I had very similar problem some time ago, and this is what I ended up doing. I cannot find this class in my resources anymore, but I remember it was working pretty well even when the view was loaded from xib.

于 2012-03-29T16:40:03.520 に答える