Android studio快捷开发插件

第一步,下载插件很简单

第二部

xml中写布局

1,一定要写id

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    tools:context="com.example.jerry.plug.MainActivity">
    <TextView
        android:id="@+id/text_t"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_gravity="center_horizontal"
        android:text="@string/app_name"/>
    <ImageView
        android:id="@+id/image_icon"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_gravity="center_horizontal"
        android:src="@drawable/ic_launcher_background"/>
    <LinearLayout
        android:id="@+id/m_container"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:orientation="vertical"></LinearLayout>
</LinearLayout>

第三部生成文件,右键在布局文件中,选择你要生成的类型


第四部 ,可以在这个弹窗中修改变量名称,修改之后,选择前边保存代码,选择后边生成类文件 ,根据自己适合来进行选择


猜你喜欢

转载自blog.csdn.net/qq_37488573/article/details/80825627