Position views so that they aren’t crowded by other content.
Position views so that they aren’t crowded by other content.
iOSエンジニアの西方です。 iPhone SEが発売されました。 個人的には大きな画面のiPhone 6 Plusシリーズが好きなので、今さら4インチに興味はなかったのですが、片手に収まるこのサイズに魅力を感じている方も少なくないでしょう。 開発者としては複雑な気分です。 そろそろ4インチユーザーが減ってくるかなと願っていた矢先の4インチデバイス再来。まだまだ4インチのサポートを切ることはできませんね。 前置きが長くなりましたが、複数の画面サイズに対応する際、なくてはならないのがAuto Layoutです。 iPhoneだけで4通りのサイズ展開となっている今、Auto Layoutなしで画面実装を進めることは難しいでしょう。 今回の投稿では、Auto Layoutの中でも少し特殊な「固有サイズの優先度」について、その意味と使い方を説明します。 固有サイズを使う Auto Layoutでビ
iPhone6 と iPhone6 Plus が発売になり、本格的に iOS でも Android のように複数解像度に対応したやり方をしないといけなくなってきました。 iPhone5S までは、縦幅が伸びただけだったので、なんとなく Auto Layout を使っていても問題は表面化しづらかったのですが、 iPhone6 で横幅が伸びてしまったことで、適当に Auto Layout を使ってコーディングしていると残念なことになっているアプリが結構あります。 僕も iPhone アプリを開発しているのでこのあたりは結構気を使ってはいるんですが、いかんせん自分のやり方がほんとに正しいのか、やや疑問なところもあります。 そこで、今の自分のやり方を晒して、世の iPhone アプリ開発者の人に突っ込んでもらえればと思い記事を書くことにしました。 間違っている箇所もあると思いますので、ドンドンツッ
今こそ frame 思考脱却の時 Xcode 4 / iOS 6 から存在していた Auto Layout でしたが、 当時は Interface Builder の Auto Layout 対応も中々ひどく、使うのが辛かった記憶があります。 そんななか僕は順調に layoutSubviews に傾倒していったわけですが、 iPhone 6/iPhone 6 plus がついに登場し、Size Class という新しい概念も投入され 現状では間違いなく2年前とは比べ物にならないレベルで Universal アプリは作りやすくなりました。(ただし iOS 8 専用アプリのみ) ある程度のデザインパターンを懐に用意していた方が時間が省けます。 ここでは Auto Layout を用いたレイアウトに関するユースケース毎に簡潔に書いていますので、 「それ知ってるわ」みたいなのがあったら適宜読み飛ば
Xcode6からSizeClassesという概念が加わったのと、AutoLayoutも微妙に変更されていて謎のMarginが出るようなので調査した結果をまとめました。 SizeClassesとは Xcode6からAutoLayoutに加え、SizeClassesという概念が加わりました。 Xcode5では、Universalアプリを作るには、iPhone向けとiPad向けのStoryboardをそれぞれ用意していましたが、Xcode6/iOS8からは、一つのStoryboard(あるいはXib)で対応させてしまおう、というのがSizeClassesです。 考え方としては、iPhoneやiPadの特定のサイズではなく、抽象的なサイズを扱うということです。ですので、今まで以上にAutoLayoutの制約によるレイアウトデザインが重要になります。 注目すべきは赤枠で囲った2箇所です。 まず右側。
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く