리스트뷰가 비었을때 empty view를 보여주고싶어요.
조회수 3699회
소스코드
<RelativeLayout android:id="@+id/LinearLayoutAR"
android:layout_height="fill_parent"
android:layout_width="fill_parent">
<ListView android:id="@+id/ARListView"
android:layout_width="fill_parent"
android:layout_height="fill_parent"></ListView>
<ProgressBar android:id="@+id/arProgressBar"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_centerVertical="true"></ProgressBar>
<!-- Here is the view to show if the list is emtpy -->
<TextView android:id="@id/android:empty"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:text="No Results" />
</RelativeLayout>
몇가지 이유가 있어서 empty view를 Text view로 보여주고 있는데요. 문제는 이 텍스트뷰가 항상 나온다는거에요. 리스트뷰가 empty가 아니어도 말이에요. 제 생각엔 자동으로 리스트뷰가 비었는지 감지할거라고 생각했는데 안그래요.
댓글 입력