2016-11-21 8 views
0

これが今の私の相対的なレイアウトである下のリストビューを置くことはできません: http://prntscr.com/d9yureは、テキストビュー

私が欲しいのはdeleteListdeleteUsersTxt下にあるが、それは私をさせません。招待リストの下に置くことしかできません。私はそれに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" /> 

はにあるように、リストの最小容量がありますか?

+0

私はあなたのコードが動作すると思います。しかし、あなたは 'deleteUsersTxt'に131dpのボトムマージンを持っているので、あなたはリストを画面の外に押しているかもしれませんか? –

答えて

0

ここには何もありませんが、すべてが間違っています。

ルートレイアウトとしてLinearLayout(垂直方向)を使用して簡単に使用できます。

その後、あなたにとって理解しやすくなります。

0

のLinearLayoutの中にそれらをグループ化してみて、このように、均等に分割:

<LinearLayout 
    android:layout_width="match_parent" 
    android:orientation="vertical" 
    android:layout_above="@id/deleteUsersTxt" 
    android:layout_alignParentLeft="true" 
    android:layout_alignParentStart="true" 
    android:layout_below="@+id/addUsersTxt" 
    android:layout_height="wrap_content"> 

    <ListView 
     android:layout_width="match_parent" 
     android:layout_height="0dp" 
     android:id="@+id/invitaionsList" 
     android:layout_weight="1" 
     android:choiceMode="multipleChoice" /> 

    <ListView 
     android:layout_width="match_parent" 
     android:layout_height="0dp" 
     android:layout_weight="1" 
     android:id="@+id/deleteList"/> 

</LinearLayout> 
関連する問題