在一个布局文件里。假设定义了非常多非常多id,代码中一个个findview是一件非常枯燥而且浪费时间的事情。

所以这里向大家推荐一个必备插件android layout id converter。

配置完毕后仅仅须要在xml文件右键点击Convert android layout xml,然后在你activity中仅仅须要粘贴,就能够帮助你自己主动生成代码。例如以下这些就是自己主动生成的:

private WheelView wheelview;
private ScrollView scrollView1;
private LinearLayout vName;
private EditText etName;
private LinearLayout vMobile;
private EditText etMobile;
private EditText etCard;
private EditText etCarOwnerName;
private LinearLayout vCarOwnerMobile;
private EditText etCarOwnerMobile;
private EditText etInsuranceCompany;
private EditText etInsuranceNum;
private EditText etBank;
private EditText etBankNumber;
private RelativeLayout vCarType;
private AppCompatSpinner spCarType;
private EditText etCarTonnage;
private TextView tvCarNum;
private EditText etCarNum;
private LinearLayout vTrailerCarNum;
private TextView tvTrailerCarNum;
private EditText etTrailerCarNum;
private ImageView iv1;
private ImageView iv3;
private ImageView iv5;
private ImageView iv2;
private ImageView iv4;
private EditText etFamilyName;
private EditText etFamilyTel;
private EditText etRelation;
private Button btnSubmit; private void assignViews() {
wheelview = (WheelView) findViewById(R.id.wheelview);
scrollView1 = (ScrollView) findViewById(R.id.scrollView1);
vName = (LinearLayout) findViewById(R.id.v_name);
etName = (EditText) findViewById(R.id.et_name);
vMobile = (LinearLayout) findViewById(R.id.v_mobile);
etMobile = (EditText) findViewById(R.id.et_mobile);
etCard = (EditText) findViewById(R.id.et_card);
etCarOwnerName = (EditText) findViewById(R.id.et_carOwnerName);
vCarOwnerMobile = (LinearLayout) findViewById(R.id.v_carOwnerMobile);
etCarOwnerMobile = (EditText) findViewById(R.id.et_carOwnerMobile);
etInsuranceCompany = (EditText) findViewById(R.id.et_insuranceCompany);
etInsuranceNum = (EditText) findViewById(R.id.et_insuranceNum);
etBank = (EditText) findViewById(R.id.et_bank);
etBankNumber = (EditText) findViewById(R.id.et_bankNumber);
vCarType = (RelativeLayout) findViewById(R.id.v_carType);
spCarType = (AppCompatSpinner) findViewById(R.id.sp_carType);
etCarTonnage = (EditText) findViewById(R.id.et_car_tonnage);
tvCarNum = (TextView) findViewById(R.id.tv_carNum);
etCarNum = (EditText) findViewById(R.id.et_carNum);
vTrailerCarNum = (LinearLayout) findViewById(R.id.v_trailerCarNum);
tvTrailerCarNum = (TextView) findViewById(R.id.tv_trailerCarNum);
etTrailerCarNum = (EditText) findViewById(R.id.et_trailerCarNum);
iv1 = (ImageView) findViewById(R.id.iv1);
iv3 = (ImageView) findViewById(R.id.iv3);
iv5 = (ImageView) findViewById(R.id.iv5);
iv2 = (ImageView) findViewById(R.id.iv2);
iv4 = (ImageView) findViewById(R.id.iv4);
etFamilyName = (EditText) findViewById(R.id.et_family_name);
etFamilyTel = (EditText) findViewById(R.id.et_family_tel);
etRelation = (EditText) findViewById(R.id.et_relation);
btnSubmit = (Button) findViewById(R.id.btn_submit);
}

Android Studio “懒人”必备插件android layout id converter的更多相关文章

  1. 懒人模式开启Android模块自动化Api之旅

    推荐阅读: 滴滴Booster移动App质量优化框架-学习之旅 一 Android 模块Api化演练 不一样视角的Glide剖析(一) 在将业务进行模块化时,避免不了模块页面路由和模块通信, 大多数我 ...

  2. 【原创】窥视懒人的秘密---android下拉刷新开启手势的新纪元

    小飒的成长史原创作品:窥视懒人的秘密---android下拉刷新开启手势的新纪元转载请注明出处 **************************************************** ...

  3. Android studio新建文件出现setContentView(R.layout.activity_main);中的R标红错误解决方法

    今天打开Android studio突然出现了setContentView(R.layout.activity_main);中的R标红错误,这已经不是第一次出现这个错误了,真心的觉得Android s ...

  4. AMD CPU环境下使用android studio,eclipse的Genymotion插件

    1.下载安装VirtualBox Genymotion的运行需要此环境(链接) 2.下载安装android模拟器Genymotion 由于官网的下载速度过慢,建议直接百度下载Genymotion(链接 ...

  5. 【Android Studio使用教程3】Android Studio的一些设置 体验更好了

    Android Studio 简单设置 界面设置 默认的 Android Studio 为灰色界面,可以选择使用炫酷的黑色界面. Settings --> Appearance --> T ...

  6. Android Studio xcode单步调试 WebRTC Android & iOS

    mac环境 如何在 Android Studio 里单步调试 WebRTC Android 的 native 代码. WebRTC 代码下载 depot tools 是 chromium 代码库管理工 ...

  7. android studio 导入一个已有的android studio project作为lib使用

    android studio 导入一个已有的android studio project作为lib使用 新项目来了. 需要搭建框架. android studio对我来说还是很陌生,之前一个项目在同事 ...

  8. 解决Android Studio Conflict with dependency 'com.android.support:support-annotations'报错

    解决Android Studio Conflict with dependency 'com.android.support:support-annotations'报错 在Android Studi ...

  9. Android studio 安装与配置【Android学习入门】

    终于下定决心认真学习Android开发了. 之前在很多平台看到很多大牛们学习Android的经验和心得,纸上得来终觉浅. 这里推荐stormzhang老师总结的Android学习之路. 为了防止电脑卡 ...

随机推荐

  1. mysql主从同步失败Last_IO_Error: Got fatal error 1236 from master解决方法

    mysql教程主从同步失败Last_IO_Error: Got fatal error 1236 from master解决方法 遇到这样的错误如:“Last_IO_Error: Got fatal ...

  2. 认识TWICImage类

    Graphics 单元新增了 TWICImage 类, 该类的功能源于新增的 Wincodec.pas 单元. WIC 支持的图像有 BMP.PNG.ICO.JPEG.GIF.TIFF.HDP(HDP ...

  3. dll通用操作单元

    dll通用操作单元 /// <author>cxg 2019-3-4</author> /// 装载(释放)DLL /// 适用于Delphi所有版本 unit ynDLL; ...

  4. poj 3041(最大匹配问题)

    http://poj.org/problem?id=3041 Asteroids Time Limit: 1000MS   Memory Limit: 65536K Total Submissions ...

  5. Unity3D 经常使用库

    JSON.NET:http://james.newtonking.com/json LitJSON: http://lbv.github.io/litjson/ ProtoBuf  - net:htt ...

  6. 在websocket中怎么样注入service类

    最近项目中用到了websocket,遇到很多问题,其中一个是@ServerEndpoint修饰的类无法注入其他的bean,注入的对象都是null,在网上找了好多资料,无意中发现一个朋友的答案给了思路. ...

  7. Android之代码创建布局

    大概描述一下效果:最外层是一个 RelativeLayout 里面有自定义个LinearLayout,每个LinearLayout有两个TextView.that's it !!! private v ...

  8. HTML5 本地文件操作之FileSystemAPI整理(一)

    一.请求配额 DeprecatedStorageInfo对象 window.webkitStorageInfo:当使用持久存储模式时需要用到该对象的接口 方法: 1.requestQuota(type ...

  9. PHP Curl实例

    URL Link : http://www.groad.net/bbs/forum-115-1.html

  10. AutoCppHeader AutoHeader 自动根据CPP 或C文件 来生成头文件。

    根据 cpp文件 生成相应的头文件 namespace 声明类定义声明 函数声明 extern 变量声明 选项--------------//[AutoHeader Public] //[AutoHe ...