Android所有系统资源图标android.R.drawable查看

转自:http://blog.csdn.net/jishu360/article/details/8540026

目录(?)[+]

1、引用方式

在源代码*.Java中可以进入如下方式引用:
myMenuItem.setIcon(android.R.drawable.ic_menu_save);
在*.XML文件中的可以进行如下引用:
android:icon="@android:drawable/ic_menu_save"

2、图标展示


alert_dark_frame

alert_light_frame

arrow_down_float

arrow_up_float

bottom_bar

btn_default

btn_default_small

btn_dialog

btn_dropdown

btn_minus

btn_plus

btn_radio

btn_star

btn_star_big_off

btn_star_big_on

button_onoff_indicator_off

button_onoff_indicator_on

checkbox_off_background

checkbox_on_background

dark_header

dialog_frame

divider_horizontal_bright

divider_horizontal_dark

divider_horizontal_dim_dark

divider_horizontal_textfield

edit_text

editbox_background

editbox_background_normal

editbox_dropdown_dark_frame

editbox_dropdown_light_frame

gallery_thumb

ic_btn_speak_now

ic_delete

ic_dialog_alert

ic_dialog_dialer

ic_dialog_email

ic_dialog_info

ic_dialog_map

ic_input_add

ic_input_delete

ic_input_get

ic_lock_idle_alarm

ic_lock_idle_charging

ic_lock_idle_lock

ic_lock_idle_low_battery

ic_lock_lock

ic_lock_power_off

ic_lock_silent_mode

ic_lock_silent_mode_off

ic_media_ff

ic_media_next

ic_media_pause

ic_media_play

ic_media_previous

ic_media_rew

ic_menu_add

ic_menu_agenda

ic_menu_always_landscape_portrait

ic_menu_call

ic_menu_camera

ic_menu_close_clear_cancel

ic_menu_compass

ic_menu_crop

ic_menu_day

ic_menu_delete

ic_menu_directions

ic_menu_edit

ic_menu_gallery

ic_menu_help

ic_menu_info_details

ic_menu_manage

ic_menu_mapmode

ic_menu_month

ic_menu_more

ic_menu_my_calendar

ic_menu_mylocation

ic_menu_myplaces

ic_menu_preferences

ic_menu_recent_history

ic_menu_report_image

ic_menu_revert

ic_menu_rotate

ic_menu_save

ic_menu_search

ic_menu_send

ic_menu_set_as

ic_menu_share

ic_menu_slideshow

ic_menu_sort_alphabetically

ic_menu_sort_by_size

ic_menu_today

ic_menu_upload

ic_menu_upload_you_tube

ic_menu_view

ic_menu_week

ic_menu_zoom

ic_notification_clear_all

ic_notification_overlay

ic_partial_secure

ic_popup_disk_full

ic_popup_reminder

ic_popup_sync

ic_search_category_default

ic_secure

menu_frame

menu_full_frame

picture_frame

presence_away

presence_busy

presence_invisible

presence_offline

presence_online

progress_indeterminate_horizontal

radiobutton_off_background

radiobutton_on_background

spinner_background

spinner_dropdown_background

star_big_off

star_big_on

star_off

star_on

stat_notify_call_mute

stat_notify_chat

stat_notify_error

stat_notify_missed_call

stat_notify_more

stat_notify_sdcard

stat_notify_sdcard_prepare

stat_notify_sdcard_usb

stat_notify_sync

stat_notify_sync_noanim

stat_notify_voicemail

stat_sys_data_bluetooth

stat_sys_download

stat_sys_download_done

stat_sys_headset

stat_sys_phone_call

stat_sys_phone_call_forward

stat_sys_phone_call_on_hold

stat_sys_speakerphone

stat_sys_upload

stat_sys_upload_done

stat_sys_vp_phone_call

stat_sys_vp_phone_call_on_hold

stat_sys_warning

status_bar_item_app_background

status_bar_item_background

sym_action_call

sym_action_chat

sym_action_email

sym_call_incoming

sym_call_missed

sym_call_outgoing

sym_contact_card

sym_def_app_icon

title_bar

title_bar_tall

toast_frame

zoom_plate

3、演示示例

如下源码:

[java]  view plain  copy
  1. import android.app.Activity;    
  2. import android.content.Context;    
  3. import android.os.Bundle;    
  4. import android.view.*;    
  5. import android.widget.*;    
  6. import android.widget.AdapterView.*;    
  7.     
  8. public class AndroidRDrawable extends Activity {    
  9.         
  10.     private AndroidRDrawable ard=this;    
  11.     private LinearLayout mainView=null;    
  12.     private TextView tv=null;    
  13.     private GridView gv=null;    
  14.     private int id=0x01080000;    
  15.         
  16.     public void onCreate(Bundle savedInstanceState) {    
  17.         super.onCreate(savedInstanceState);    
  18.         mainView=new LinearLayout(this);    
  19.         mainView.setOrientation(LinearLayout.VERTICAL);    
  20.         tv=new TextView(this);    
  21.         tv.setText("这里显示图标名称和id及其尺寸");    
  22.         gv_init();    
  23.         mainView.addView(tv);    
  24.         mainView.addView(gv);    
  25.         setContentView(mainView);    
  26.     }    
  27.         
  28.     /*gv初始化*/    
  29.     void gv_init(){    
  30.         gv=new GridView(this);    
  31.         GridView.LayoutParams lp=new GridView.LayoutParams(-1,-1);    
  32.         gv.setLayoutParams(lp);    
  33.         gv.setNumColumns(GridView.AUTO_FIT);    
  34.         gv.setVerticalSpacing(10);    
  35.         gv.setHorizontalSpacing(10);    
  36.         gv.setAdapter(new ImageAdapter(this));    
  37.         gv.setFocusableInTouchMode(true);    
  38.         gv.setOnItemClickListener(new OnItemClickListener(){    
  39.             public void onItemClick(AdapterView arg0, View arg1, int arg2,long arg3) {    
  40.                 tv.setText("图标名称:"+ard.getResources().getResourceEntryName(0x01080000+arg2)+"\n");    
  41.                 tv.append("图标Id:0x"+Integer.toHexString(0x10800000+arg2)+"\n");    
  42.                 tv.append("图标大小:"+arg1.getWidth()+"x"+arg1.getHeight()+"\n");    
  43.             }    
  44.         });    
  45.         gv.setOnItemSelectedListener(new OnItemSelectedListener(){    
  46.             public void onItemSelected(AdapterView arg0, View arg1,int arg2, long arg3) {    
  47.                 tv.setText("图标名称:"+ard.getResources().getResourceEntryName(0x01080000+arg2)+"\n");    
  48.                 tv.append("图标Id:0x"+Integer.toHexString(0x10800000+arg2)+"\n");    
  49.                 tv.append("图标大小:"+arg1.getWidth()+"x"+arg1.getHeight()+"\n");    
  50.             }    
  51.             public void onNothingSelected(AdapterView arg0) {    
  52.                 
  53.             }    
  54.         });    
  55.     }    
  56.         
  57.     class MyThread extends Thread{    
  58.             
  59.     }    
  60.         
  61.     /*ImageAdapter*/    
  62.     public class ImageAdapter extends BaseAdapter {    
  63.     
  64.         private Context context;    
  65.             
  66.         public ImageAdapter(Context c) {context = c;}    
  67.             
  68.         public int getCount() {return 152;}    
  69.         public Object getItem(int position) {return position;}    
  70.         public long getItemId(int position) {return position;}    
  71.     
  72.         public View getView(int position, View convertView, ViewGroup parent) {    
  73.             ImageView iv = new ImageView(context);    
  74.             iv.setLayoutParams(new GridView.LayoutParams(-2,-2));    
  75.             id=0x01080000+position;    
  76.             iv.setImageResource(id);    
  77.             iv.setScaleType(ImageView.ScaleType.CENTER_CROP);    
  78.             return iv;    
  79.         }    
  80.     }    
  81. }    

你可能感兴趣的:(Android)