2013-01-03 Auto Layoutチュートリアル その5 UIView Tutorial 今回はSubviewを横に並べて、かつ幅を自動調整するサンプルを説明したいと思います。 サンプル: https://github.com/stack3/STLayoutViewSample サンプルのMenu画面のAuto LayoutセクションからHorizontalを選択します。ありがちなTextField + Button、Label + TextFieldの組み合わせです。 横に回転するとTextFieldのみ幅が伸びます。 Long Text Buttonを押すと今度はSearch ButtonとName Labelのテキストが変更されて幅が伸びます。 このレイアウトを調整する部分は、プログラムを一切書いてません。Auto LayoutのConstraintだけで実現できているので