Android 如何生成背景图像?

Android 如何生成背景图像?,android,background-image,Android,Background Image,我的布局如下所示- <ScrollView xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="wrap_content" android:layout_height="wrap_content" > <LinearLayout android

我的布局如下所示-

<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content" >

<LinearLayout
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:background="@drawable/background"
    android:orientation="vertical"
    android:paddingBottom="@dimen/activity_vertical_margin"
    android:paddingLeft="@dimen/activity_horizontal_margin"
    android:paddingRight="@dimen/activity_horizontal_margin"
    android:paddingTop="@dimen/activity_vertical_margin"
    android:scrollbars="vertical"
    tools:context="com.example.MainActivity$FragmentRegister" >

    ...
下图-

如何从该图像生成有效背景?它们的尺寸应该是多少?我应该为横向模式生成单独的图像吗?我应该在那里使用吗

将ImageView与ScaleType属性一起使用

<ImageView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:src="@drawable/background"
android:scaleType="fitXY"
/>

我更喜欢预先生成图像,而不是在运行时缩放它们。所以,问题是关于预生成图像的大小。