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.
私はアプリを開発していますが、iPhone 5 の画面の余分なスペースを利用するために、この のスタイルを変更したいと考えていUISegmentedControlます。したがって、これには 2 つの部分が含まれます。まず、iPhone 5 かどうかをコードで検出してから、スタイルを変更します。
UISegmentedControl
3.5インチではこのスタイルになります
そして4インチでこれ。
で画面サイズを確認してください[[UIScreen mainScreen] bounds]。bounds.size.height が特定の数値よりも大きい場合 (それを決定します)、セグメント化されたコントロールのsegmentedControlStyleプロパティを設定します。あなたが望むより大きな高さのためにUISegmentedControlStylePlain。その他については、あなたがしたいですUISegmentedControlStyleBar。
[[UIScreen mainScreen] bounds]
segmentedControlStyle
UISegmentedControlStylePlain
UISegmentedControlStyleBar