Android文件命名规范初版

这个是老黄总结的,我搬了上来记录留着一下

资源命名规则:

()  Layout命名

1contentview命名:activity_功能模块_属性说明.xml

例如:activity_main.xmlactivity_more.xml

2Dialog命名:dialog_描述_属性说明.xml

       例如:dlg_hint.xml

2PopupWindow命名: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,adpteridadpter_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

 


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值