SORU
25 NİSAN 2010, Pazar


Nasıl'in arkaplan resmini tekrar android uygulaması yapmak

Benim app bir arka plan görüntüsü ayarlamak var, ama arka plan görüntüsü küçük ve tekrarlanması ve tüm ekranı doldurmak istiyorum. Ne yapmalıyım?

<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">

CEVAP
25 NİSAN 2010, Pazar


Tamam, burada benim app var. Bir kaydırma yaparken siyah olacak ListViews önlemek için kesmek içerir.

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">
//

Bunu Paylaş:
  • Google+
  • E-Posta
Etiketler:

YORUMLAR

SPONSOR VİDEO

Rastgele Yazarlar

  • David MeShow

    David MeShow

    10 EKİM 2006
  • ibebrent

    ibebrent

    23 Temmuz 2007
  • Nick Pitera

    Nick Pitera

    8 NİSAN 2006