我是Android新手。单击一个按钮我需要添加相对布局,进一步单击我想要将相同的相对布局与不同的值附加到先前的相对布局等相同的按钮,依此类推,它应该垂直完成。稍后我将从布局中读取值。
点击清晰的内部布局,我也可以删除添加的布局。
有什么方法可以做到?
布局代码,
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="match_parent">
<EditText
android:id="@+id/number"
style="@style/Edit_Text"
android:enabled="false"
android:tag="phone_number"
android:hint="Phone Number"
android:inputType="phone"
/>
<TextView
android:id="@+id/remove"
android:layout_width="30dip"
android:layout_height="30dip"
android:layout_alignParentRight="true"
android:text="x"
android:gravity="center"
android:layout_centerVertical="true"
android:layout_marginRight="2dip"/>