【发布时间】:2017-04-17 07:46:21
【问题描述】:
我的Master/Detail 基于模板的应用程序的详细视图中有这个问题。
我在详细视图中填充可扩展列表。它在平板电脑视图中运行良好。但在移动设备中,它只向我显示第一个结果。我什至尝试删除CollapsingToolbarLayout 以确保列表视图不会被任何其他滚动选项阻塞。但我找不到问题。
设置适配器
ArrayList<ClientList> clientLists = ClientList.getClientList(getActivity(), clientResult);
Log.e("Client","--"+clientLists.size()); //Im getting the list size as normal
clientExpandableAdapter = new ClientExpandableAdapter(getActivity(), clientLists);
expandableListView.setAdapter(clientExpandableAdapter);
expandableListView.setOnChildClickListener(new ExpandableListView.OnChildClickListener() {
@Override
public boolean onChildClick(ExpandableListView expandableListView, View view, int i, int i1, long l) {
return false;
}
});
详细视图布局
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/item_detail"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="com.xxx.xxx.ItemDetailFragment"
android:textIsSelectable="true"
android:paddingBottom="16dp">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="16dp"
android:background="@drawable/bottom_border"
android:id="@+id/mainViewHeader">
<TextView android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="18sp"
android:id="@+id/titleHeader"
android:text="Clients" />
<TextView android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:id="@+id/titleCountHeader"
android:text="Clients"
/>
</RelativeLayout>
<RelativeLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@id/mainViewHeader"
android:id="@+id/backgroundView"
android:background="@color/colorWhite">
<ExpandableListView
android:id="@+id/mainExpandableDatalist"
android:layout_width="match_parent"
android:layout_height="wrap_content" >
</ExpandableListView>
</RelativeLayout>
</RelativeLayout>
【问题讨论】:
标签: android listview expandablelistview master-detail