開発中のテスト プログラムに簡単なレイアウトを実装しました。画面には、ロゴ用の画像が 1 つだけあり、プログラムのタイトルを含む textView とボタンがあります。各要素を新しい行に配置したいので、線形レイアウトを使用しようとしています。私の場合、画像とテキストは非常に近いかもしれませんが、ボタンをページの下部に表示したいと考えています。私は自分が間違っていることを理解していません。また、「下」の値を持つボタンに android:layoutGravity プロパティを追加しましたが、何も変更されていません。これは私が使用しているコードです:
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/background">
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:paddingBottom="@dimen/activity_vertical_margin"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="0sp"
tools:context=".DiLand"
android:orientation="vertical" >
<ImageView
android:id="@+id/logo"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="0sp"
android:src="@drawable/logo2" />
<TextView
android:id="@+id/title"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/titleApp"
android:textColor="@color/titleColor"
android:textSize="35sp"
android:gravity="top"
android:layout_marginTop="0sp"
/>
<Button
android:layout_width="140sp"
android:layout_height="50sp"
android:text="@string/startButton"
android:id="@+id/start_button"
android:background="@drawable/start_button"
android:textColor="@color/whiteColor"
android:textSize="30sp"
android:layout_gravity="bottom"
/>
</LinearLayout>
</ScrollView>
手伝ってくれてありがとう!