背景画像のあるログインフォームでスクロールビューを使用したいのですが、画像が伸びます。
私のコードは次のようになります:
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center"
android:orientation="vertical"
android:id="@+id/login_layout" >
<LinearLayout
android:layout_width="250dp"
android:layout_height="270dp"
android:layout_marginTop="40dp"
android:gravity="center"
android:orientation="vertical"
android:background="@drawable/login" >
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="30dp"
android:orientation="vertical" >
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/username_login" />
<EditText
android:id="@+id/username_login"
android:inputType="text"
android:layout_width="200dp"
android:layout_height="30dp"
android:paddingLeft="5dp"
android:paddingTop="2dp"
android:background="@drawable/edit_text" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/password_login" />
</LinearLayout>
</LinearLayout>
</LinearLayout>
</ScrollView>
ユーザー名とパスワードの 2 つのテキスト編集と、ログイン ボタンがあります。
の
android:background="@drawable/login"
テキスト編集とボタンを保持するレイアウトの背景画像です
何か助けてください?
アクティビティ内に(伸びる)背景を設定したことを知っています
アクティビティ内に背景を設定しています
private void setBackground(){
LinearLayout layout = (LinearLayout) findViewById(R.id.login_layout);
layout.setBackgroundDrawable(application.getBackground01());
}