开发者

Android: LevelListDrawable isn't work?

开发者 https://www.devze.com 2023-02-26 03:13 出处:网络
Trying to use LevelListDrawable for my ImageView...But it\'s not working... <?xml version=\"1.0\" encoding=\"utf-8\"?>

Trying to use LevelListDrawable for my ImageView...But it's not working...

<?xml version="1.0" encoding="utf-8"?>
<level-list xmlns:android="http://schemas.android.com/apk/res/android" >
<item
    android:drawable="@drawable/icon1"
    android:maxLevel="0" />
<item
    android:drawable="@drawable/icon2"
    android:maxLevel="1" />
<item
    android:开发者_开发技巧drawable="@drawable/icon3"
    android:maxLevel="2" />
</level-list>

This thing i saved in drawable folder...and named as custom_image.xml...

 <ImageView 
        android:id="@+id/someId" 
        android:layout_height="wrap_content" 
        android:layout_width="wrap_content"  
        android:layout_gravity="center"
        android:layout_centerHorizontal="true"
        android:layout_centerVertical="true"
        android:src = "@drawable/custom_image"/>

But my images don't want change...All the time icon1 is shown....What I do wrong ? Thanks..

0

精彩评论

暂无评论...
验证码 换一张
取 消