码迷,mamicode.com
首页 > 移动开发 > 详细

Android代码生成器使用说明

时间:2016-05-12 12:39:33      阅读:217      评论:0      收藏:0      [点我收藏+]

标签:

项目地址:http://www.aoeai.com:8081/android-code-generator/

1、选择需要生成代码的布局文件,例如:
技术分享

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical"
    android:gravity="center_horizontal">

    <include layout="@layout/toolbar" />

    <View
        android:layout_width="match_parent"
        android:layout_height="1dp"
        android:layout_marginTop="@dimen/dp_16"
        />

    <TextView
        android:id="@+id/tv_title"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:textSize="@dimen/char_16"
        android:textColor="@color/char_black"
        android:padding="@dimen/dp_16"
        android:text="系统升级给您添麻烦了,欢迎从以下市场下载最新版本"
        android:textIsSelectable="true"
        android:layout_marginLeft="@dimen/dp_16"
        android:layout_marginRight="@dimen/dp_16"/>

    <View
        android:layout_width="match_parent"
        android:layout_height="1dp"
        android:layout_marginTop="@dimen/dp_16"
         />

    <TextView
        android:id="@+id/market"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:textSize="@dimen/char_16"
        android:textColor="@color/char_black"
        android:padding="@dimen/dp_16"
        android:text="Google"
        android:textIsSelectable="true"
        android:layout_marginLeft="@dimen/dp_16"
        android:layout_marginRight="@dimen/dp_16"/>

    <Button
        android:id="@+id/btn_submit"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="提交"/>

</LinearLayout>

2、复制包含id的布局文件代码到输入框,之后点击提交即可生成Java代码
技术分享
结果如下:
技术分享

Android代码生成器使用说明

标签:

原文地址:http://blog.csdn.net/wyyl1/article/details/51366651

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!