一、项目需求
在新建旅游行程的过程中因为旅游天数是不确定的,所以我们需要提供可选方案给客户。这里我们可以根据需要点击加号按钮生成对应的天数,根据需要删除对应的天数。演示图如下:
二、xml文件如下:
<?xml version="1.0" encoding="utf-8"?>
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:scrollbars="none">
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/activity_guide_route"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:orientation="vertical">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="100dip"
android:text="新建旅游行程"
android:textSize="20dip" />
<LinearLayout
android:id="@+id/linearLayout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="30dip"
android:gravity="center">
<TextView
android:id="@+id/tv_day1"
android:layout_width="40dip"
android:layout_height="wrap_content"
android:text="Day 1" />
<EditText
android:id="@+id/et_day1"
android:layout_width="150dip"
android:layout_height="wrap_content"
android:layout_marginLeft="15dip"
android:background="@drawable/edit_register_bg" />
<ImageButton
android:id="@+id/btn_create"
android:layout_width="21dip"
android:layout_height="21dip"
android:layout_marginLeft="10