android 系统图标的使用

来源:互联网 发布:哪个虚拟机装mac好 编辑:程序博客网 时间:2024/05/17 23:32

android学习过程中,经常遇到没有合适的图标可以使用,很是苦恼,其实系统已经预备了一些的图标,而你只需要知道怎么使用就行了!

1.在Java代码中直接如下引用就行了:

int icon = android.R.drawable.arrow_down_float;mImageButton.setBackgroundResource(icon);

 

和自己提供的图标引用的区别仅在于:就是以android.R 开头而已


2.在xml中可以这样:

 android:src="@android:drawable/ic_input_delete"

 

和自己提供的图标引用的区别仅在于:就是以android: 开头而已

 

贴一张系统图标图,该图是:

Android™ 1.5 android.R.drawable Icon Resources

 

图片来源:http://www.darshancomputing.com/android/1.5-drawables.html