Ich versuche, einen Parallax-Effekt mit Android Material Design zu erstellen. Bitte beachten Sie die folgenden Haupt-XML-Code ...Parallax Effekt funktioniert nicht in Android Material Design
<?xml version="1.0" encoding="utf-8"?>
<android.support.design.widget.CoordinatorLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true"
tools:context="com.mydomain.filterlistview.MainActivity">
<android.support.design.widget.AppBarLayout
android:layout_width="match_parent"
android:layout_height="180dp"
android:fitsSystemWindows="true">
<android.support.design.widget.CollapsingToolbarLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true"
app:contentScrim="?attr/colorPrimary"
app:layout_scrollFlags="scroll|exitUntilCollapsed">
<android.support.v7.widget.Toolbar
android:id="@+id/toolbar"
android:minHeight="0dp"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
app:layout_collapseMode="pin"
app:popupTheme="@style/AppTheme.PopupOverlay"/>
</android.support.design.widget.CollapsingToolbarLayout>
</android.support.design.widget.AppBarLayout>
<!--<android.support.v7.widget.SearchView-->
<!--android:id="@+id/search_view"-->
<!--android:layout_width="match_parent"-->
<!--android:layout_height="wrap_content" />-->
<android.support.v7.widget.RecyclerView
android:id="@+id/recycler_view"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginBottom="5dp"
app:layout_behavior="@string/appbar_scrolling_view_behavior"/>
</android.support.design.widget.CoordinatorLayout>
ich die Toolbar verstecken wollte, wenn die RecyclerView wird nach oben gerollt und umgekehrt. Aber das passiert nicht.
Unten ist mein build.gradle ..
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:23.2.1'
compile 'com.android.support:recyclerview-v7:23.2.1'
compile 'com.android.support:cardview-v7:23.2.1'
compile 'com.android.support:design:23.2.1'
}
Android Material Design Android Material Design
pls überprüfen und lassen Sie mich wissen, dass dies auch für Sie funktioniert .. –
Dies funktioniert, habe ich vergessen, das ActionBar-Thema zu ändern. Aber ich habe noch einen Zweifel. Es wird die Symbolleiste nicht vollständig ausgeblendet. –
versuchen, app: layout_collapseMode = "pin" diese Zeile aus der Symbolleiste –