团队作业第二天
用户部分为:个人主页,添加订单页面,订单页面,查询页面四个页面
为了方便首先写了一个导航控件
<?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="wrap_content"
android:background="#CCCCFF">
<Button
android:id="@+id/order"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_gravity="center"
android:layout_marginLeft="30dp"
android:text="订单"
></Button>
<Button
android:id="@+id/add"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:text="添加"
android:layout_gravity="center"
></Button>
<Button
android:id="@+id/modify"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:text="修改"
></Button>
<Button
android:id="@+id/my"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_gravity="center"
android:layout_marginRight="2dp"
android:text="我的"></Button>
</LinearLayout>
然后是控件的运用重构之后就可以直接插入运行了
package com.e.recily;
import android.content.Context;
import android.util.AttributeSet;
import android.view.LayoutInflater;
import android.widget.LinearLayout;
import androidx.annotation.Nullable;
public class guide extends LinearLayout {
public guide(Context context, @Nullable AttributeSet attrs) {
super(context, attrs);
LayoutInflater.from(context).inflate(R.layout.guide,this);
}
}

浙公网安备 33010602011771号