Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/207.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 如何为ScrollView设置固定图像背景?_Android_Layout - Fatal编程技术网

Android 如何为ScrollView设置固定图像背景?

Android 如何为ScrollView设置固定图像背景?,android,layout,Android,Layout,我应该想要scrollview滚动条,而不是背景中的图像。将图像添加到scrollview框架之前视图层次结构的更高位置。示例如下: <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="

我应该想要scrollview滚动条,而不是背景中的图像。

将图像添加到scrollview框架之前视图层次结构的更高位置。

示例如下:

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
 xmlns:android="http://schemas.android.com/apk/res/android"
 android:layout_width="match_parent"
 android:layout_height="match_parent"
 android:background="@drawable/background_image"
 android:orientation="vertical">

 <ListView
  android:id="@+id/category_list"
  android:layout_width="match_parent"
  android:layout_height="wrap_content"
  android:cacheColorHint="@android:color/transparent"/>

 <TextView
  android:id="@android:id/empty"
  android:layout_width="match_parent"
  android:layout_height="wrap_content"/>

</LinearLayout>


在这里,线性布局保留了背景图像。该列表将以透明背景显示在其上方。有关此主题的更多信息,请查看

对不起:您的答案也可以帮助我,但我只有一个“接受答案”。普兰蒂:谢谢你:-)