这个是老黄总结的,我搬了上来记录留着一下
资源命名规则:
(一) Layout命名
1.contentview命名:activity_功能模块_属性说明.xml
例如:activity_main.xml、activity_more.xml
2.Dialog命名:dialog_描述_属性说明.xml
例如:dlg_hint.xml
2.PopupWindow命名:ppw_描述_属性说明.xml
例如:ppw _info_comm.xml
3. 适配器项命名adpter_控件描述_属性说明.xml
例如:adepter_list_city.xml
(二) 图片命名
1. 前缀_模块、前缀_模块_描述、前缀_模块_描述_后缀
例如:bg_mainActivity.png、
icon_btn_sure_left.png、
img_main_logo、
bg_btn_cancel_press.png
(三) id命名
类型缩写_所在上下文_属性
例如登陆界面的确定按钮:
btn_loginActivity_ sure
有一个listView,其adpter的id为adpter_list_users.xml
其适配器布局文件中一个CheckBox的命名为
chb_list_users_checksure
组件名称缩写对照表
组件名称 | 简写 | 组件名称 | 简写 |
Button | btn | RadioButton | rbtn |
ImageButton | ibtn | TextView | tv |
ImageView | iv | ListView | lv |
ProgressBar | pbar | EditText | et |
ScrollView | scly | CheckBox | chk |
RelativeLayout | rlyt | LinearLayout | llyt |
TableLayout | tlyt | AbsoluteLayout | alyt |
FrameLayout | flyt |
|
|
资源对应类中命名:
如资源名字btn_plotting_analysis,类中对应名称为btnPlottingAnalysis。
如资源名字btn_search_sure,类中对应名称为btnSearchSure。