程序笔记   发布时间:2022-07-19  发布网站:大佬教程  code.js-code.com
大佬教程收集整理的这篇文章主要介绍了安卓 命名规范大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。

命名规范

变量

命名方式 场景
s<Field> 静态变量
<field> 成员变量,以小写开头、驼峰法命名;
tv<View> 组件,以组件小写开头、驼峰法命名,如 btnSubmit;
<FIELD> 常量,所有单词大写,中间用下划线分割。

常见缩写

@H_46_15@msg
名称 缩写
icon ic (主要用在app的图标)
color cl(主要用于颜色值)
divider di(主要用于分隔线,不仅包括Listview中的divider,还包括普通布局中的线)
SELEctor sl(主要用于某一view多种状态,不仅包括Listview中的SELEctor,还包括按钮的SELEctor)
average avg
BACkground Bg(主要用于布局和子布局的背景)
buffer buf
control ctrl
delete del
document doc
error err
escape esc
increment inc
infomation info
initial init
image img
Internationalization I18N
length len
library lib
message
password- pwd
position pos
server srv
String str
temp tmp
window wnd(win)

view缩写

@H_46_15@mgView 或则 iv @H_46_15@mapView @H_46_15@mapVi
控件 缩写
LayoutView lv
RelativeView rv
TextView tv
Button btn
ImageButton imgBtn
ImageView
checkBox chk
RadioButton rdoBtn
analogClock anaClk
DigtalClock dgtClk
DatePicker dtPk
EditText edtTxt
TimePicker tmPk
toggleButton tglBtn
ProgressBar proBar
SeekBar skBar
AutoCompleteTextView autoTxt
ZoomControls zmCtl
VideoView vdoVi
WdbView webVi
RanTingBar ratBar
Tab tab
Spinner spn
Chronometer cmt
ScollView sclVi
TextSwitch txtSwt
ImageSwitch imgSwt
listView lVi 或则lv
ExpandableList epdLt

大佬总结

以上是大佬教程为你收集整理的安卓 命名规范全部内容,希望文章能够帮你解决安卓 命名规范所遇到的程序开发问题。

如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。

本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。