Level List
来源:互联网 发布:小提琴调音软件苹果 编辑:程序博客网 时间:2024/05/05 10:22
Level List
用户管理图片需要相互切换显示。
文件存放位置:
res/drawable/
语法:
<?xml version="1.0" encoding="utf-8"?><level-list xmlns:android="http://schemas.android.com/apk/res/android" > <item android:drawable="@drawable/drawable_resource" android:maxLevel="integer" android:minLevel="integer" /></level-list>
用法:
level_list_button_checkable.xml
<?xml version="1.0" encoding="utf-8"?><level-list xmlns:android="http://schemas.android.com/apk/res/android" > <item android:drawable="@drawable/checkbox" android:maxLevel="0" /> <item android:drawable="@drawable/checkbox_selected" android:maxLevel="1" /></level-list>layout_level_list.xml:
<?xml version="1.0" encoding="utf-8"?><RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical" > <Button android:id="@+id/button1" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_centerHorizontal="true" android:layout_centerVertical="true" android:background="@drawable/level_list_button_checkable" android:text="Button" /></RelativeLayout>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 {@Overrideprotected void onCreate(Bundle savedInstanceState) {super.onCreate(savedInstanceState);setContentView(R.layout.layout_level_list) ;finalButton b = (Button)this.findViewById(R.id.button1) ;b.setOnClickListener(new View.OnClickListener() {@Overridepublic void onClick(View v) {System.out.println("level change"+b.getBackground().getLevel());b.getBackground().setLevel(1) ;}}) ;}}
点击前:
点击后:
- Level List
- level-list
- android中的level-list
- level-list使用1
- android drawable Level List
- level-list 的大坑
- android level-list 笔记
- android api level list
- Android drawable level-list
- android level-list的使用
- Android--(level-list)资源文件
- layer-list和level-list标签
- 显示不同的图片--level-list
- launcher研究之自定义level-list
- level—list设置背景用法
- List of High Paying Entry Level Jobs
- level-list显示不同的图片
- Pat(Advanced Level)Practice--1028(List Sorting)
- Swing进度条样例
- IOS项目中AppDelegate详解
- Linux用户密码策略
- Android4.0 framebuffer 学习笔记(1)
- source insight移除工程出错的处理方法
- Level List
- 跨浏览器之--事件绑定
- android内存分析
- ios面试题02
- Jcms模板设参时候,设置完某个标签单元后,模板刷新出现500错误问题解决方法。
- http://docs.oracle.com/javase/6/docs/
- Android 中的消息通知Notification
- C++中概念区分:Overload, Override, Hide
- asp.net 调用exe文件