Ich versuche, meine ActionBar/Symbolleiste auf Swipe mit einem vertikalen ViewPager, das ist mein MainActivity
XML zu verstecken:hide ActionBar auf Swipe vertikale viewPager
<android.support.v4.widget.DrawerLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/drawer_layout"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:ignore="InconsistentLayout">
<android.support.design.widget.CoordinatorLayout
android:id="@+id/coordinator_layout"
android:layout_width="match_parent"
android:layout_height="match_parent">
<android.support.design.widget.AppBarLayout
android:id="@+id/appbar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:fitsSystemWindows="true">
<include
android:id="@+id/toolbar"
layout="@layout/view_toolbar" />
</android.support.design.widget.AppBarLayout>
<include layout="@layout/view_home" />
</android.support.design.widget.CoordinatorLayout>
<include layout="@layout/view_left_drawer" />
</android.support.v4.widget.DrawerLayout>
ich meine Symbolleiste hinzugefügt: app:layout_scrollFlags="scroll|enterAlways"
ich habe nur eine leere Seite in meinem Fragment, das ViewPager
nicht sichtbar:
<?xml version="1.0" encoding="utf-8"?>
<android.support.v4.widget.NestedScrollView
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:isScrollContainer="false"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_gravity="fill_vertical"
android:background="@color/greeen_theme"
android:clipToPadding="false"
app:layout_behavior="@string/appbar_scrolling_view_behavior">
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:background="@color/light_theme_color_read"
android:layout_width="match_parent"
android:layout_height="match_parent">
<Button
android:id="@+id/refreshListBtn"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="5dp"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:layout_marginTop="10dp"
android:background="@drawable/bg_refresh_list_button_selector"
android:textColor="@android:color/white"
android:visibility="visible"/>
<com.axample.android.view.SwipeRefreshLayout
android:id="@+id/swiperefresh"
android:layout_width="match_parent"
android:layout_height="match_parent">
<com.axample.android.adapter.vertical.VerticalViewPager
android:id="@+id/viewpager"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingBottom="@dimen/pager_padd_botom"
android:clipToPadding="false"/>
</com.axample.android.view.SwipeRefreshLayout>
</RelativeLayout>
</android.support.v4.widget.NestedScrollView>
Video: https://www.youtube.com/watch?v=sWknAZFs6RA
Bitte Hilfe !!
Update: mein view_left_drawer.xml
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/left_drawer"
android:layout_width="240dp"
android:layout_height="match_parent"
android:layout_gravity="start"
android:background="@color/black_main"
tools:showIn="@layout/activity_home">
<include layout="@layout/view_drawer_content"/>
</FrameLayout>
mein SwipeRefreshLayout
: https://github.com/FredJul/Flym/blob/master/Flym/src/main/java/net/fred/feedex/view/SwipeRefreshLayout.java
Diese App auf Symbolleiste: layout_scrollFlags = "scroll | enterAlways" – MinnuKaAnae
Danke, jetzt, nachdem ich die ActionBar scrollen versteckt, aber immer noch leerer Bildschirm, ich werde meinen Fragment-Code hinzufügen. –
Einmal Android entfernen: Sichtbarkeit = "weg" von der Schaltfläche und überprüfen oder fügen Sie einige Hintergrundfarbe, um zu überprüfen, ob es funktioniert oder nicht – MinnuKaAnae