我有一个框架布局,包含一个edittext和按钮(用于删除字段),当用户单击按钮时,我想多次添加到相对布局。多次添加预定义的framelayout到相对布局
我已经搜查,但我只是无法找到如何以编程方式做到这一点。
android:id="@+id/inputbox"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginTop="20dp"
android:textSize="25sp"
android:textStyle="bold"
android:hint="@string/inputhint"
android:ems="10"
android:imeOptions="actionNext"
android:singleLine="true" />
android:id="@+id/buttonremove"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginRight="10dp"
android:layout_gravity="right|center_vertical"
android:background="@drawable/remove" />
+0
您希望生成的布局看起来如何?垂直行中的所有FrameLayouts? –
+0
是的。所以会有一排垂直的文字输入。在使用此框架布局动态创建的前后有两个非动态输入 –