内容へ移動
猫型iPS細胞研究所
ユーザ用ツール
ログイン
サイト用ツール
検索
ツール
文書の表示
以前のリビジョン
バックリンク
最近の変更
メディアマネージャー
サイトマップ
ログイン
>
最近の変更
メディアマネージャー
サイトマップ
現在位置:
INDEX
»
android
»
LinearlayoutとViewの位置
トレース:
android:linearlayoutとviewの位置
この文書は読取専用です。文書のソースを閲覧することは可能ですが、変更はできません。もし変更したい場合は管理者に連絡してください。
====== LinearlayoutとViewの位置 ====== ===== LinearLayoutで並べたViewを均等に並べる ===== <code> <LinearLayout android:layout_width="match_parent" android:layout_height="50dp" android:orientation="vertical" android:background="@color/head" > <androidx.appcompat.widget.AppCompatTextView android:layout_width="match_parent" android:layout_height="0dp" // ←高さは0dpにする android:layout_weight="1" // ←1対1の場合 android:text="ああああ"/> <androidx.appcompat.widget.AppCompatTextView android:layout_width="match_parent" android:layout_height="0dp" // ←高さは0dpにする android:layout_weight="1" // ←1対1の場合 android:text="ああああ"/> </LinearLayout> </code> ===== FrameLayoutでViewを中心に置く ===== <code> <com.google.android.material.circularreveal.CircularRevealFrameLayout android:layout_width="match_parent" android:layout_height="match_parent"> <androidx.appcompat.widget.AppCompatImageView android:id="@+id/result" android:layout_width="70dp" android:layout_height="70dp" android:layout_gravity="center_vertical|center_horizontal" // layout_gravityを設定する。 /> </code> ===== TextViewの文字の位置を中止にする ===== <code> <androidx.appcompat.widget.AppCompatTextView android:id="@+id/quest" android:layout_width="match_parent" android:layout_height="match_parent" android:textSize="20sp" android:gravity="center" // ただのgravityはViewの内側の位置の設定ができる android:background="@drawable/radius"/> </code>
android/linearlayoutとviewの位置.txt
· 最終更新: 2019/11/10 16:38 by
ips
ページ用ツール
文書の表示
以前のリビジョン
バックリンク
文書の先頭へ