开发者

How to put an fix image background for ScrollView?

开发者 https://www.devze.com 2023-01-29 20:12 出处:网络
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 frameAn example would be:

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

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号