mit dem einfachsten Beispiel mit AppBarLayout und Toolbar, kann ich nicht die Overscroll-Animation (das Glühen von unten oder oben) beim Scrollen mehr zu sehen. Wenn Sie jedoch den Inhalt umwerfen, wird er angezeigt. HierLollipop AppBarLayout/Toolbar fehlende Overscroll Animation
ist der Code (nav_drawer_toolbar_layout.xml):
<android.support.design.widget.CoordinatorLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent">
<!-- Replace fragments in this content frame, like a RecycleView -->
<FrameLayout
android:id="@+id/content_frame"
app:layout_behavior="android.support.design.widget.AppBarLayout$ScrollingViewBehavior"
android:layout_width="match_parent"
android:layout_height="match_parent" />
<android.support.design.widget.AppBarLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar">
<android.support.v7.widget.Toolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:minHeight="?attr/actionBarSize"
app:titleTextAppearance="@style/Base.TextAppearance.AppCompat.Title"
app:popupTheme="@style/ThemeOverlay.AppCompat.Light"
app:layout_scrollFlags="scroll|enterAlways"/>
</android.support.design.widget.AppBarLayout>
</android.support.design.widget.CoordinatorLayout>
Gefolgt von einfacher Aktivitätsklasse:
public class MyActivity extends AppCompatActivity implements {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.nav_drawer_toolbar_layout);
// Setup the toolbar/actionbar
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
setSupportActionBar(toolbar);
FragmentManager manager = getFragmentManager();
manager.beginTransaction().replace(R.id.content_frame, new MyFragmentList).commit();
}
}
MyFragmentList ist ein Fragment mit einem RecycleView mit Inhalt die App zu blättern.
Wenn ich jedoch AppBarLayout aus dem XML entferne und die Toolbar offen lasse (einfach AppBarLayout öffnen und schließen), wird beim Scrollen die Overscroll-Animation (das Glühen) angezeigt.
Oder wenn Sie layout_scrollFlags="scroll"
entfernen, funktioniert der Overscroll, aber Sie können die Aktionsleiste nicht ausblenden, wenn Sie scrollen.
Für zusätzliche Informationen, Debuggen RecycleView, Linie 2272
if(this.mBottomGlow != null && !this.mBottomGlow.isFinished()) {
ist immer fertig, wenn AppBarLayout einschließlich und nicht fertig, wenn sie nicht da ist. Überschreibt etwas seine Touch-Events?
Weiß jemand, wer Overscroll-Animation (glühen) mit AppBarLayout zeigen?
Hi @ user654628 Haben Sie ein Update dazu? Ich habe das gleiche Problem wie Sie jetzt: / – CodingBird