您的位置:首页 > 移动开发

How to make android app’s background image repeat.

2010-05-13 09:15 591 查看
here's what I've got in my app. Is includes a hack to prevent 
ListView
s from going black while scrolling.

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">
//
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  android image encoding