Оба макета доступны в библиотеке поддержки appcompat 7.Могу ли я использовать SwipeRefreshLayout внутри DrawerLayout?
Я не получаю должного результата.
У меня есть DrawerLayout как корневой макет, а затем внутри него один текстовый вид ошибки. а затем SwipeRefreshLayout
Это текстовое изображение было видно, когда корневой макет был FrameLayout. Но с тех пор, как я изменил корневую компоновку на DrawerLayout, ошибка в тексте никогда не обнаруживается!
Я использую его правильно?
<android.support.v4.widget.DrawerLayout 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:background="@android:color/transparent"
tools:context="com.timesbuzz.news.MainActivity"
android:id="@+id/drawer_layout">
<TextView
android:id="@+id/errorView"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:gravity="center"
android:text="@string/error_view_text"
android:textSize="30sp" />
<ProgressBar
android:id="@+id/loadingView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:indeterminate="true" />
<android.support.v4.widget.SwipeRefreshLayout
android:id="@+id/contentView"
android:layout_width="match_parent"
android:layout_height="match_parent">
<!-- android.support.v4.view.ViewPager -->
<fr.castorflex.android.verticalviewpager.VerticalViewPager
android:id="@+id/viewPager"
android:layout_width="match_parent"
android:layout_height="match_parent" />
</android.support.v4.widget.SwipeRefreshLayout>
<!-- The navigation drawer -->
<ListView
android:id="@+id/navdrawer"
android:layout_width="200dp"
android:layout_height="match_parent"
android:layout_gravity="start"
android:background="@android:color/white"
android:choiceMode="singleChoice"
android:divider="@android:color/transparent"
android:dividerHeight="0dp"
android:drawSelectorOnTop="false">
</ListView>
</android.support.v4.widget.DrawerLayout>
Кто голосовал вниз. заботиться, чтобы объяснить? –
добавьте 'FrameLayout' в качестве первого дочернего элемента 'DrawerLayout' и' TextView, ProgressBar, SwipeRefreshLayout' в качестве дочерних элементов этого 'FrameLayout' и проверки. – Bharatesh