Я бы хотел (а) создать изображение в качестве фона списка. Для каждого элемента нет ни одного элемента, но для всех, и которые не перемещаются при перемещении списка. Как это сделать?ListView with background image
4
A
ответ
13
Я хотел бы сделать что-то вроде этого:
<RelativeLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<ImageView
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:src="@drawable/the_background_image"/>
<ListView
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:cacheColorHint="#00000000"/>
</RelativeLayout>
1
я использовал это:
<ListView
android:id="@android:id/list"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_below="@id/lists_header"
android:layout_marginLeft="6dip"
android:layout_marginRight="6dip"
android:divider="@drawable/list_divider"
android:dividerHeight="2dip"
android:cacheColorHint="@color/shopper_background"
android:background="@drawable/paper_frame" />
Где paper_frame является 9.patch вытяжке.
Это обеспечивает (растянутое, чтобы заполнить область ListView) фиксированное фоновое изображение, которое не прокручивается вместе со списком, и может быть тем, что вы пытаетесь сделать.
Я хочу, чтобы изображение растягивалось как высота списка (т. Е. Верхний и/или нижний могут быть на экране, если список длинный), и я ищу, как это сделать.
Смежные вопросы
- 1. background-image with parallax
- 2. ListView background image crop
- 3. Bootstrap background-image with CSS
- 4. SVG fill with background image
- 5. Layering JPanels with background image
- 6. html background with image & color
- 7. Bootstrap-background image with content overlay
- 8. ipad/iphone app with fixed background image
- 9. CSS Background-Image issue with safari
- 10. cell background image with text itextsharp
- 11. Button with BOTH color and background image
- 12. Set Tableview background with Image and Label
- 13. Xamarin Forms: Entry with background image
- 14. background-blend-mode with Gradient и Image
- 15. background-image with tr and th
- 16. background image fadein fade out with jQuery
- 17. Inline stretchy button with CSS background image
- 18. Trouble with Retina & CSS background image
- 19. Android Studio Fullscreen Background Image with android: background
- 20. android background image on background image
- 21. Set Image ListView With If Statement
- 22. thumbnail image with AsyncTask
- 23. UIButton image/background image weirdness
- 24. Blur background with Viewbox
- 25. wpf grid background with image brush и visual brush together
- 26. Тип входного изображения vs button with background-image
- 27. Заменить css background image with Font Awesome icon
- 28. background image repeat with! Important правильный код css
- 29. IOS Mobile Safari background image position with CSS
- 30. Reflected-repeat background image with css или js?
Я попытался дать верхнему элементу фон, но он просто не работал должным образом. Это сделало обаяние. благодаря – Warpzit