您可以嘗試從我的代碼下面的TestView覆蓋 ExpandableListView並不可見。 我希望它位於頂部,然後是ExpandableListView,底部是LinearLayout和一些元素。ExpandableListView在RelativeLayout中隱藏TextView
你知道爲什麼會發生這種情況,以及如何解決? 感謝
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
>
<TextView
android:id="@+id/tvteam"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_above="@+id/listViewTeams"
android:text="test"
/>
<ExpandableListView
android:id="@+id/listViewTeams"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="tvteam"
/>
<LinearLayout
android:id="@+id/llbottom"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:orientation="vertical"
>
<EditText
android:id="@+id/searchteam"
android:layout_width="@dimen/editwidthsml"
android:layout_height="@dimen/editheightsml"
android:singleLine="true"
android:imeOptions="actionSearch"
android:layout_margin="2dp"
android:hint="@string/searchteam" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:weightSum="3"
>
<Button
android:id="@+id/btnfilterteams1"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:background="@drawable/selectorface"
android:text="@string/tourneyteams"
android:tag="btnfilterteams1"
/>
<Button
android:id="@+id/btnfilterteams2"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:background="@drawable/selectorface"
android:text="@string/allteams"
android:tag="btnfilterteams2"
/>
<Button
android:id="@+id/btnfilterteams3"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:background="@drawable/selectorface"
android:text="@string/playersonly"
android:tag="btnfilterteams3"
/>
</LinearLayout>
</LinearLayout>
</RelativeLayout>
在我把TextView的出的RelativeLayout的時刻,在LinearLayout中wapped所有但我想有更好的想法 – Gyonder