Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/image/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Android 如何优化分辨率为1920x1080的图像,以使其成为背景?_Android_Image_Background Image_Android Drawable - Fatal编程技术网

Android 如何优化分辨率为1920x1080的图像,以使其成为背景?

Android 如何优化分辨率为1920x1080的图像,以使其成为背景?,android,image,background-image,android-drawable,Android,Image,Background Image,Android Drawable,我的应用程序中有一个Tabhost,其中有5个选项卡。我通过将android:background=“@drawable/background”放在xml文件中,在我的tabhost上设置了一个背景图像,但不幸的是,整个ui变得滞后。如何优化图像以消除UI中的延迟?请帮我拿这个 <TabHost xmlns:android="http://schemas.android.com/apk/res/android" android:id="@android:id/tabhost"

我的应用程序中有一个Tabhost,其中有5个选项卡。我通过将
android:background=“@drawable/background”
放在xml文件中,在我的tabhost上设置了一个背景图像,但不幸的是,整个ui变得滞后。如何优化图像以消除UI中的延迟?请帮我拿这个

<TabHost xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@android:id/tabhost"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
android:background = "@drawable/background">

    <LinearLayout
        android:id="@+id/LinearLayout01"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        android:orientation="vertical" >

        <LinearLayout
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:background="#FCAFA6"
            android:orientation="vertical" >

            <ImageView
                android:layout_width="fill_parent"
                android:layout_height= "52dp"
                android:background="@drawable/header" />

            <TextView
                android:id="@+id/tabTitle"
                android:layout_width="fill_parent"
                android:layout_height="wrap_content"
                android:layout_marginBottom="5dp"
                android:gravity="center"
                android:text="Home"
                android:textColor="#FFFFFF" />
        </LinearLayout>

        <FrameLayout
            android:id="@android:id/tabcontent"
            android:layout_width="fill_parent"
            android:layout_height="fill_parent"
            android:layout_weight="1">
        </FrameLayout>

        <TabWidget
            android:id="@android:id/tabs"
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:layout_weight="0" >
        </TabWidget>
    </LinearLayout>

</TabHost>


您必须制作各种设备大小的背景并放在相应的文件夹中以获取更多信息检查此:

检查:为什么要删除带有自定义接口的connectToServer问题?