這是現在我的相對佈局下: http://prntscr.com/d9yure不能把列表視圖中的文本視圖
所有我想要的是deleteList
是下deleteUsersTxt
,但它不會讓我。它只允許我把它放在邀請名單下面。我試圖添加到它android:layout_below="@+id/deleteUsersTxt"
,但它只是使它消失。
這是XML:
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent"
android:layout_height="match_parent" android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
android:paddingBottom="@dimen/activity_vertical_margin"
tools:context="meet.projectoklahoma.Activities.CreateEventActivity">
<ListView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="@+id/invitaionsList"
android:layout_above="@id/deleteUsersTxt"
android:choiceMode="multipleChoice"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:layout_below="@+id/addUsersTxt" />
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/other"
android:id="@+id/otherButton"
android:onClick="setDate"
android:layout_alignTop="@+id/tomorrowButton"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceMedium"
android:text="@string/which_day"
android:id="@+id/whichDayTxt"
android:layout_below="@+id/eventNameTextBox"
android:layout_alignParentRight="true"
android:layout_alignParentEnd="true" />
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/tomorrow"
android:id="@+id/tomorrowButton"
android:onClick="tomorrow"
android:layout_alignTop="@+id/todayButton"
android:layout_toRightOf="@+id/otherButton"
android:layout_toEndOf="@+id/otherButton" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceSmall"
android:text="whichDay"
android:id="@+id/dayTxt"
android:layout_below="@+id/whichDayTxt"
android:layout_alignRight="@+id/whichDayTxt"
android:layout_alignEnd="@+id/whichDayTxt" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceSmall"
android:text="date"
android:id="@+id/dateTxt"
android:layout_below="@+id/dayTxt"
android:layout_alignRight="@+id/dayTxt"
android:layout_alignEnd="@+id/dayTxt" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceMedium"
android:text="@string/which_time"
android:id="@+id/timeTxt"
android:layout_below="@+id/dateTxt"
android:layout_alignParentRight="true"
android:layout_alignParentEnd="true" />
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/choose_time"
android:id="@+id/whichTimeBtn"
android:layout_alignTop="@+id/timeTxt"
android:layout_alignLeft="@+id/todayButton"
android:layout_alignStart="@+id/todayButton"
android:onClick="setTime"
/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceSmall"
android:text="whichTime"
android:id="@+id/whichTimeTxt"
android:layout_below="@+id/timeTxt"
android:layout_alignParentRight="true"
android:layout_alignParentEnd="true"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceMedium"
android:text="@string/add_users_to_event"
android:id="@+id/addUsersTxt"
android:layout_below="@+id/whichTimeBtn"
android:layout_alignParentRight="true"
android:layout_alignParentEnd="true" />
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/today"
android:id="@+id/todayButton"
android:onClick="today"
android:layout_alignBottom="@+id/dayTxt"
android:layout_toLeftOf="@+id/timeTxt"
android:layout_toStartOf="@+id/timeTxt" />
<EditText
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/eventNameTextBox"
android:text="שם האירוע"
android:layout_alignParentTop="true"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true" />
<TextView
android:text="הסרת משתמשים מהאירוע:"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/deleteUsersTxt"
android:layout_marginBottom="131dp"
android:layout_above="@+id/cancelAndDeleteButton"
android:layout_alignParentRight="true"
android:layout_alignParentEnd="true"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true" />
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/delete_and_cancel"
android:id="@+id/cancelAndDeleteButton"
android:onClick="deleteEvent"
android:layout_alignParentBottom="true"
android:layout_alignParentRight="true"
android:layout_alignParentEnd="true" />
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="סבבה"
android:id="@+id/SaveEventButton"
android:onClick="editEvent"
android:layout_alignParentBottom="true"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true" />
<ListView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="@+id/deleteList"
android:layout_below="@+id/invitaionsList"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true" />
是否有一個列表是在最小的空間?
我覺得你的代碼工作。但是,因爲你在'deleteUsersTxt'上有一個131dp的底部空白頁:你可能會將列表推到屏幕之外? –