废话不多说,这是地址: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);

    }

最新文章

  1. SQL Server数据库镜像的页面自动修复原理
  2. 突破瓶颈,对比学习:Eclipse开发环境与VS开发环境的调试对比
  3. IOS 线程处理 子线程
  4. 检索COM 类工厂中 CLSID 为 {} 的组件时失败
  5. JS练习题1共7题
  6. poj 2632 Crashing Robots
  7. ThinkPHP目录结构
  8. 【javascript 函数基础知识】
  9. 两种动态载入修改后的python模块的方法
  10. 今天刚申请成为Uber司机 已经接了5单了....大家有什么想问的吗?
  11. 使用jquery+一般处理程序异步载入信息
  12. Java内存模型_顺序一致性
  13. java 多态 向上 向下转型
  14. 使用loadrunner编写webservice接口请求
  15. Kubernetes集群搭建之企业级环境中基于Harbor搭建自己的私有仓库
  16. oracle中next_day()、last_day()函数解析
  17. Linux基础实践
  18. UVALive5874 - Social Holidaying-二分图匹配/匈牙利算法
  19. 正则的使用及replace细讲
  20. cxgrid中,如何根据列名或字段名取得footer值

热门文章

  1. head first 设计模式读书笔记 之 策略模式
  2. Scala的类中定义内部类实战
  3. 从零开始学 iOS 开发的15条建议
  4. [Android]The connection to adb is down, and a severe error has occured.
  5. JS把字符串转换为数字的方法
  6. GridView.GridLines 属性
  7. UpdatePanel + 弹出框
  8. headfirst之装饰模式
  9. 【转】在Spring中基于JDBC进行数据访问时怎么控制超时
  10. JavaSE复习日记 : 递归函数