あなたはこのような質問のためのドキュメントを見てみる必要があります。
ドキュメントhereでお勧めするように、私は通常Relative Layout
を使用します。
centerInParent
,およびcenterVertical
は、これらの場合に完全に機能します。
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="American Writers"
android:textAppearance="@style/TextAppearance.AppCompat.Display1"
android:layout_centerHorizontal="true"/>
<Spinner
android:id="@+id/spinner"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:entries="@array/author_names"
android:layout_centerInParent="true">
</Spinner>
</RelativeLayout>
私はそれが役に立てば幸い:それらを使用して
例、。
ああ、わかりました。これは、多くの助け、ありがとう。 – Sam
@Samあなたの問題を解決した場合は、これを回答としてマークする必要があります – hellyale