参考: stackoverflow.com ImageViewを表示する時あらかじめアス比を指定したい。 この場合はImageViewをConstraintLayout直下に入れてdimentionRatioを設定する。 <android.support.constraint.ConstraintLayout ... > <ImageView android:layout_width="0dp" android:layout_height="0dp" app:layout_constraintDimensionRatio="h,1:1" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintStart_toStartOf="
はじめに みなさんConstraintLayoutは使っているでしょうか? ConstraintLayoutはGoogleI/O 2016で新しく登場したLayoutです。その名の通り制約によってレイアウトを決めること複雑なレイアウトを、ネストを深くせずに作ることが出来るようになりました。 RelativeLayoutと似ていますが、iOSのAutoLayoutのようにAndroid Studio上のLayoutEditorでドラックアンドドロップによって簡単にレイアウトが作れます。 また、Android Developers Blogでは、RelativeLayoutに比べてパフォーマンスが約 40% 優れているといっています。 Our performance comparison shows that ConstraintLayout performs about 40% better
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く