How to put an fix image background for ScrollView?
I should want the sc开发者_如何学Gorollview scroll, but not the image in its background.
Add the image higher up the view hierarchy ahead of your scrollviews frame
An example would be:
<?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>
Here the Linearlayout holds the backround image. The list will be displayed above this with an transparent background. For further informations on this topic have a look at ListView Backgrounds
精彩评论