Как сделать повторение фонового изображения приложения

Я установил фоновое изображение в своем приложении, но фоновое изображение является маленьким, и я хочу, чтобы оно было повторено и заполнило целый экран.Что мне делать?

<LinearLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:orientation="vertical"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:background="@drawable/bg"
    android:tileMode="repeat">
312
задан Fantômas 10 February 2018 в 23:16
поделиться

1 ответ

Хорошо, вот что у меня есть в приложении. Он включает в себя хитрость, предотвращающую потемнение объектов ListView во время прокрутки.

drawable / app_background.xml :

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

values ​​/ styles.xml :

<?xml version="1.0" encoding="utf-8"?>
<resources>

  <style name="app_theme" parent="android:Theme">
    <item name="android:windowBackground">@drawable/app_background</item>
    <item name="android:listViewStyle">@style/TransparentListView</item>
    <item name="android:expandableListViewStyle">@style/TransparentExpandableListView</item>
  </style>

  <style name="TransparentListView" parent="@android:style/Widget.ListView">
    <item name="android:cacheColorHint">@android:color/transparent</item>
  </style>

  <style name="TransparentExpandableListView" parent="@android:style/Widget.ExpandableListView">
    <item name="android:cacheColorHint">@android:color/transparent</item>
  </style>

</resources>

AndroidManifest.xml :

//
<application android:theme="@style/app_theme">
//
423
ответ дан 23 November 2019 в 01:10
поделиться
Другие вопросы по тегам:

Похожие вопросы: