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和 ...
随机推荐
- jquery 选择器之children与find
children()和find() 两个用于向下遍历 DOM 树的 jQuery 方法 children() 方法返回被选元素的所有直接子元素. find() 方法返回被选元素的后代元素,一路向下直到 ...
- cookie程序设计举例
编写Cookie应用程序,一般流程是:首先尝试获取某个Cookie变量,如果有,则表明是老客户,读取其cookie信息,为其提供服务. 如果没有,则表明是第一次来访的客户,通过表单提交获取其身份信息, ...
- php部分学习笔记
[web 开发分为]1. 静态web 开发(html 页面) 如果我们的一个页面,始终是一成不变的,则就是属于静态web 开发,一般讲用html 技术就ok2. 动态web 开发 比如: 我们需要发帖 ...
- JS中格式化数据保留两位小数
问题:在JS中格式化数据保留两位小数的函数的多种方法 最好方法: 保留两位好像是这样吧 var a = 9.39393; alert(a.toFixed(2)); 说明: ...
- Oracle EBS-SQL (GL-3):从总帐追溯到发票
SELECT je_header_id, je_line_num, trx_class_name, trx_type_name, trx_number_displayed, trx_date,comm ...
- C++ 下 typeof 的实现
现在我们有这样一坨代码: std::vector<int> arr; // ... for(std::vector<int>::iterator iter = arr.begi ...
- 使用C#开发Metro 风格应用的路线图 -- 触屏操作
原文 http://www.cnblogs.com/icuit/archive/2012/05/01/2478312.html win8支持多点触摸技术,而我们在屏幕上所做的各种操作,也最终转换为输入 ...
- poj2823_单调队列简单入门
题目链接:http://poj.org/problem?id=2823 #include<iostream> #include<cstdio> #define M 100000 ...
- poj2141---字符串转换
#include <stdio.h> #include <stdlib.h> int main() { ]; char tmp; scanf("%s",ke ...
- Android 开发ListView适配器优化
我们都知道Android中Adapter的作用就是ListView界面与数据之间的桥梁,当列表里的每一项显示到页面时,都会调用Adapter的getView方法返回一个View.想过没有? 在我们的列 ...