xml version="1.0" encoding="utf-8"?>
<level-listxmlns:android&#61;"http://schemas.android.com/apk/res/android" ><itemandroid:drawable&#61;"&#64;drawable/drawable_resource"android:maxLevel&#61;"integer"android:minLevel&#61;"integer" />
layout_level_list.xml:
LevelListActivity.java:
package com.hualu.animation.levellist;import com.hualu.animation.R;import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;public class LevelListActivity extends Activity {&#64;Overrideprotected void onCreate(Bundle savedInstanceState) {super.onCreate(savedInstanceState);setContentView(R.layout.layout_level_list) ;final Button b &#61; (Button)this.findViewById(R.id.button1) ;b.setOnClickListener(new View.OnClickListener() {&#64;Overridepublic void onClick(View v) {System.out.println("level change"&#43;b.getBackground().getLevel());b.getBackground().setLevel(1) ;}}) ;}
}
点击前&#xff1a;