![](https://img-blog.csdnimg.cn/20201014180756919.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
Android优雅之路
丶小天
未完待续。。。
展开
-
Android优雅之路——(1)全局变量快速m命名
全局变量快速m命名 一般在定义全局非静态变量的时候,使用m作为前缀是一种规范化命名(静态变量使用s作为变量名的前缀),通过studio的设置可以快速弹出来,像这样:private TextView mTextView; 1. Android studio设置路径:File → Settings → Editor → Code St原创 2017-03-27 18:44:43 · 1369 阅读 · 0 评论 -
Android优雅之路——findViewBy Button
判断Button的Id的优化性: 当我们在一个布局文件中创建很多个View的时候,例如说:Button, 1. 初始化Button需要getActivity().findViewById(R.id.button); 该方法返回id为button的Button实例对象,如果有多个Button的话,那我们就需要多次调用findViewById()方法,这样就显得很麻烦原创 2017-04-02 15:32:24 · 796 阅读 · 1 评论