我想为 android 平台创建一个灵活的用户界面。
基本上我的布局将包括一个图像按钮,开头带有“加号”符号。当用户点击它时。调用另一个布局,提示用户命名假设创建的图像按钮。当用户单击确认时,他将返回第一个布局,新添加的图像按钮将替换“加号”符号图像按钮和加号图像按钮将向右移动。
我最初知道如何创建布局,但我不知道如何对其进行编程以按照我上面描述的方式运行。
好的,现在我的主布局文件是这样设置的:
<?xml version="1.0" encoding="utf-8"?>
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:fillViewport="true" >
<RelativeLayout
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:background="#000000" >
<ImageButton
android:id="@+id/addRoom"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:layout_marginLeft="25dp"
android:layout_marginTop="38dp"
android:background="#80000000"
android:src="@drawable/plus" />
<TextView
android:id="@+id/textView1"
android:layout_width="@+id/addRoom"
android:layout_height="wrap_content"
android:layout_alignLeft="@+id/addRoom"
android:layout_alignRight="@+id/addRoom"
android:layout_below="@+id/addRoom"
android:text="@string/add_room"
android:gravity="center"
android:textColor="#FFFFFF" />
</RelativeLayout>
</ScrollView>
当我包含片段以移动图像按钮和文本视图时,我会遇到任何问题吗?