1
swipeaRefreshLayout 및 툴바 (v-21을 사용하는 v4 및 v7의 두 가지 모두)가있는 레이아웃이 있지만, 앱을 시작하면 해당 목록보기가 숨김으로 툴바 만 볼 수 있습니다. 액션 바처럼.툴바가있는 SwipeRefreshLayout (v4)은 목록보기를 숨 깁니다.
<?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">
<android.support.v7.widget.Toolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?attr/colorPrimary" />
<android.support.v4.widget.SwipeRefreshLayout
android:id="@+id/swipe_container"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/toolbar"
android:layout_toEndOf="@id/toolbar">
<ListView
android:id="@+id/questionList"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/swipe_container"
android:layout_gravity="center_horizontal"
android:layout_toEndOf="@id/swipe_container"
android:background="#686868"
android:visibility="visible" />
<com.shamanland.fab.FloatingActionButton
android:id="@+id/btnNew"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_alignParentEnd="true"
android:layout_marginBottom="50dp"
android:layout_marginRight="32dp" />
<LinearLayout
android:id="@+id/emptyData"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_gravity="center"
android:background="#686868"
android:clickable="true"
android:orientation="vertical"
android:visibility="gone">
<TextView
android:id="@+id/textView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:padding="4dp"
android:text="No hay elementos disponibles"
android:textAppearance="?android:attr/textAppearanceLarge"
android:textColor="@android:color/white"
android:textStyle="bold" />
<ImageView
android:id="@+id/imageView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:paddingBottom="4dp"
android:src="@android:drawable/ic_dialog_email" />
</LinearLayout>
</android.support.v4.widget.SwipeRefreshLayout>
</RelativeLayout>