废话不多说,这是地址: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代码的工具)的更多相关文章

  1. 在线数据库表(sql语句)生成java实体类工具

    相信每个做java开发的读者,都接触过SQL建表语句,尤其是在项目开发初期,因为数据库是项目的基石. 在现代项目开发中,出现了许多ORM框架,通过简单的实体映射,即可实现与数据库的交互,然而我们最初设 ...

  2. android动画具体解释六 XML中定义动画

    动画View 属性动画系统同意动画View对象并提供非常多比view动画系统更高级的功能.view动画系统通过改变绘制方式来变换View对象,view动画是被view的容器所处理的,由于View本身没 ...

  3. 【转】Intellij IDEA 14中使用MyBatis-generator 自动生成MyBatis代码

    Intellij IDEA 14 作为Java IDE 神器,接触后发现,非常好用,对它爱不释手,打算离开eclipse和myeclipse,投入Intellij IDEA的怀抱. 然而在使用的过程中 ...

  4. Intellij IDEA 14中使用MyBatis-generator 自动生成MyBatis代码

    一:项目建立好及其基本的测试好 二:在maven项目的pom.xml 添加mybatis-generator-maven-plugin 插件 <build> <finalName&g ...

  5. IDEA 中使用MyBatis-generator 自动生成MyBatis代码

    0.在Intellij IDEA创建maven项目 1. 在maven项目的pom.xml 添加mybatis-generator-maven-plugin 插件 <build> < ...

  6. 如何在 js 代码中使用 jsp 标签或 Java 代码

    JSP 标签还是很方便的,比如 Struts.Spring 等提供给我们的 JSP 标签,可以用它们来获取变量或进行一些计算.比如 struts2 的 <s:url value="/a ...

  7. Eclipse中的快捷键快速生成常用代码(例如无参、带参构造,set、get方法),以及Java中重要的内存分析(栈、堆、方法区、常量池)

    (一)Eclipse中的快捷键:  ctrl+shift+f自动整理选择的java代码 alt+/ 生成无参构造器或者提升信息 alt+shift+s+o 生成带参构造 ctrl+shift+o快速导 ...

  8. 如何在Mirth Connect中创建和调用自定义Java代码

    0-前言 本文章将向您展示如何创建自定义Java类,将其编译/打包到JAR中,将其包含在Mirth Connect在,并在JavaScript中调用它,您可以从任何JavaScript上下文调用自定义 ...

  9. Android开发:《Gradle Recipes for Android》阅读笔记(翻译)3.5——在flavors间合并java代码

    问题: 你想要在单独的product flavors里面增加Acitivity或者其它java类. 解决方案: 创建合适的代码目录,增加java类,将它们和main代码合并. 讨论: flavors和 ...

随机推荐

  1. IE的事件与w3c事件的区别

    14. offsetWidth, scrollLeft, scrollHeight?     scrollLeft:设置或获取位于对象左边界和窗口中目前可见内容的最左端之间的距离 scrollHeig ...

  2. python模块—optparse

    处理命令行参数 1 #-*-coding:utf-8-*- __author__ = 007 __date__ = 16 / 1 / 19 from optparse import OptionPar ...

  3. [LeetCode]题解(python):153-Find Minimum in Rotated Sorted Array

    题目来源: https://leetcode.com/problems/find-minimum-in-rotated-sorted-array/ 题意分析: 在一个不重复的翻转的数组里面找到最小那个 ...

  4. 看IT牛人博客的哲理

    潜意识追求复杂的东西 想着用C语言包揽所有的事情 对于不同问题,不同领域 各种技术和方案都有着自己最为优势的解决方法 对要解决的问题的领域的理解很重要

  5. 深入Android媒体存储服务(一):APP与媒体存储服务的交互

    简介: 本文介绍如何在 Android 中,开发者的 APP 如何使用媒体存储服务(包含MediaScanner.MediaProvider以及媒体信息解析等部分),包括如何把 APP 新增或修改的文 ...

  6. 投资学第一章 investments-introduction

    转载请注明来自souldak,微博:@evagle 砖搬多了有点累,今天学学投资学. 这章主要是一些重要的概念.   real assets / financial assets , fixed-in ...

  7. Linux 内核优化

    声明:本文档来自互联网整理部份加自已实验部份所得: TCP 相关部份   经常使用名词说明: retries(再试).   TCP server <---> client通信状态      ...

  8. 遍历文件夹及其子文件夹下的.pdf文件,并解压文件夹下所有的压缩包

    List<PDFPATH> pdfpath = new List<PDFPATH>(); List<string> ziplist = new List<st ...

  9. CheckBox只选择一项

    最近做一个问卷的页面,客户那边说要使用checkbox而且只能选择一项 就写了下面的代码 <html xmlns="http://www.w3.org/1999/xhtml" ...

  10. oracle与sql server时间差的取法

    Oracle: oracle 两个时间相减默认的是天数 oracle 两个时间相减默认的是天数*24 为相差的小时数 oracle 两个时间相减默认的是天数*24*60 为相差的分钟数 oracle ...