Android Layout Binder(在线将XML中View find出来,生成java代码的工具)
废话不多说,这是地址:http://android.lineten.net/layout.php。
有图有真相,比如:

你的XML假如是这样:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical" >
<ImageView
android:id="@+id/logo"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:background="@drawable/ic_logo" />
<Button
android:id="@+id/version_btn"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@id/logo"
android:layout_centerHorizontal="true"
android:layout_marginTop="@dimen/dp_54"
android:textColor="@color/colFFFFFF"
android:textSize="18sp"
android:text="版本号:1.0.0"
android:background="@drawable/bg_version_btn" />
<TextView
android:id="@+id/companyname_tv"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_centerHorizontal="true"
android:background="@color/transparent"
android:text="@string/companyname"
android:textColor="@color/col8d8d8d"
android:layout_marginBottom="@dimen/font_size_40"
android:textSize="14sp" />
<TextView
android:id="@+id/email_tv"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_centerHorizontal="true"
android:layout_marginBottom="@dimen/dp_22"
android:text="邮箱:bd@che08.com"
android:textColor="@color/colA0A0A0"
/>
</RelativeLayout>
生成代码例如以下:
// Content View Elements
private ImageView mLogo;
private Button mVersion_btn;
private TextView mCompanyname_tv;
private TextView mEmail_tv;
// End Of Content View Elements
private void bindViews() {
mLogo = (ImageView) findViewById(R.id.logo);
mVersion_btn = (Button) findViewById(R.id.version_btn);
mCompanyname_tv = (TextView) findViewById(R.id.companyname_tv);
mEmail_tv = (TextView) findViewById(R.id.email_tv);
}
Android Layout Binder(在线将XML中View find出来,生成java代码的工具)的更多相关文章
- 在线数据库表(sql语句)生成java实体类工具
相信每个做java开发的读者,都接触过SQL建表语句,尤其是在项目开发初期,因为数据库是项目的基石. 在现代项目开发中,出现了许多ORM框架,通过简单的实体映射,即可实现与数据库的交互,然而我们最初设 ...
- android动画具体解释六 XML中定义动画
动画View 属性动画系统同意动画View对象并提供非常多比view动画系统更高级的功能.view动画系统通过改变绘制方式来变换View对象,view动画是被view的容器所处理的,由于View本身没 ...
- 【转】Intellij IDEA 14中使用MyBatis-generator 自动生成MyBatis代码
Intellij IDEA 14 作为Java IDE 神器,接触后发现,非常好用,对它爱不释手,打算离开eclipse和myeclipse,投入Intellij IDEA的怀抱. 然而在使用的过程中 ...
- Intellij IDEA 14中使用MyBatis-generator 自动生成MyBatis代码
一:项目建立好及其基本的测试好 二:在maven项目的pom.xml 添加mybatis-generator-maven-plugin 插件 <build> <finalName&g ...
- IDEA 中使用MyBatis-generator 自动生成MyBatis代码
0.在Intellij IDEA创建maven项目 1. 在maven项目的pom.xml 添加mybatis-generator-maven-plugin 插件 <build> < ...
- 如何在 js 代码中使用 jsp 标签或 Java 代码
JSP 标签还是很方便的,比如 Struts.Spring 等提供给我们的 JSP 标签,可以用它们来获取变量或进行一些计算.比如 struts2 的 <s:url value="/a ...
- Eclipse中的快捷键快速生成常用代码(例如无参、带参构造,set、get方法),以及Java中重要的内存分析(栈、堆、方法区、常量池)
(一)Eclipse中的快捷键: ctrl+shift+f自动整理选择的java代码 alt+/ 生成无参构造器或者提升信息 alt+shift+s+o 生成带参构造 ctrl+shift+o快速导 ...
- 如何在Mirth Connect中创建和调用自定义Java代码
0-前言 本文章将向您展示如何创建自定义Java类,将其编译/打包到JAR中,将其包含在Mirth Connect在,并在JavaScript中调用它,您可以从任何JavaScript上下文调用自定义 ...
- Android开发:《Gradle Recipes for Android》阅读笔记(翻译)3.5——在flavors间合并java代码
问题: 你想要在单独的product flavors里面增加Acitivity或者其它java类. 解决方案: 创建合适的代码目录,增加java类,将它们和main代码合并. 讨论: flavors和 ...
随机推荐
- 解决IE8下VS2005,VS2008一些向导提示脚本错误问题
Some VS2005 and VS2008 Wizards Pop Up Script Error. Visual C++ team has discovered that after inst ...
- mini-httpd源码分析-match.h
//字符串匹配,匹配返回 1,否则返回 0. //pattern可以通过任意个 | 字符,组合match_one中pattern的功能 int match(const char* pattern, c ...
- C 中注意的小问题
输入:char ch[100],gets(ch); scanf("%d",&in); char ch,ch=getchar(); VC: 所有变量声明放在所有操作前面: ...
- Codeforces 263E
Codeforces 263E 原题 题目描述:一个\(n \times m\)的矩阵,每格有一个数,给出一个整数\(k\),定义函数\(f(x, y)\): \[f(x, y)=\sum_{i=1} ...
- [LeetCode][Python]16: 3Sum Closest
# -*- coding: utf8 -*-'''__author__ = 'dabay.wang@gmail.com' 16: 3Sum Closesthttps://oj.leetcode.com ...
- centos6.5 openvpn安装配置
http://m.jb51.net/?host=www.jb51.net&src=http%3A%2F%2Fwww.jb51.net%2Fsoftjc%2F150885.html
- schema文件中cube的事实表使用视图方法
在cube中可以使用查询结果或者视图来当做事实表,其中view的alias相当于表名,这个要和同一个cube中的level的表名对应,代码如下: <Cube name="YHZXZLF ...
- ZooKeeper源码阅读(二):客户端
源代码: http://svn.apache.org/repos/asf/zookeeper/trunk/ 导入eclipse: 在包含build.xml目录下执行ant eclipse将产生.cla ...
- hdu 2850 Load Balancing (优先队列 + 贪心)
题目大意: 怎么分配n个任务到m个server上使得负载尽量平衡. 思路: 将任务从大到小排序,依次放入负载最小的那个server中. 由于是spj 的缘故,所以能够使用这个贪心. 比方数据 6 2 ...
- 关于ajax的那些事
什么是ajax AJAX即“Asynchronous Javascript And XML”(异步JavaScript和XML),是指一种创建交互式网页应用的网页开发技术. Ajax包含下列技术:基于 ...