R
R
ravend72016-07-29 16:49:56
Android
ravend7, 2016-07-29 16:49:56

How to scroll background image along with listbox?

I wanted to add a background image to the ListView that would scroll along with the list items. The
project implemented repeat for the background image:
activity_main.xml:

<?xml version="1.0" encoding="utf-8?>
<ListView xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="@layout/repeat_background" />

repeat_background.xml:
<?xml version="1.0" encoding="utf-8?>
<bitmap xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:src="@drawable/back"
    android:tileMode="repeat"/>

but the background remains static,
is there an equivalent of "background-attachment: scroll" from CSS ( htmlbook.ru/css/background-attachment ) ?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Denis Zagaevsky, 2016-07-29
@zagayevskiy

Googled for you. stackoverflow.com/questions/14155881/how-to-get-a-...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question