この文書の現在のバージョンと選択したバージョンの差分を表示します。
両方とも前のリビジョン 前のリビジョン 次のリビジョン | 前のリビジョン | ||
android:linearlayoutとviewの位置 [2019/11/10 16:30] ips ↷ android:layoutとviewの位置 から android:linearlayout へページを名称変更しました。 |
android:linearlayoutとviewの位置 [2019/11/10 16:38] (現在) ips |
||
---|---|---|---|
ライン 1: | ライン 1: | ||
- | ====== LinearLayout ====== | + | ====== LinearlayoutとViewの位置 ====== |
===== LinearLayoutで並べたViewを均等に並べる ===== | ===== LinearLayoutで並べたViewを均等に並べる ===== | ||
ライン 26: | ライン 26: | ||
</LinearLayout> | </LinearLayout> | ||
</code> | </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> | ||
+ |