Ich habe eine CoordinatorLayout mit AppbarLayout, die Symbolleiste und TabLayout enthält und enthalten ViewPager zeigt 3 Fragmente, die RecyclerView von CardView enthält.Toolbar gescrollt, wenn PopupMenu zeigt
Das Problem ist, wenn ein ImageView (3 Punkte) auf CardView das PopupMenu zeigt, aber die Toolbar hochgescrollt wird.
this is the design with toolbar showing
the issue when clicking then toolbar disappears
Dies ist mein Container Aktivität xml
<?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"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true"
android:id="@+id/coordinatorLayout">
<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:background="?attr/colorPrimary"
app:layout_scrollFlags="scroll|enterAlways"
app:popupTheme="@style/ThemeOverlay.AppCompat.Light" />
<android.support.design.widget.TabLayout
android:id="@+id/tabs"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:tabMode="fixed"
app:tabGravity="fill"/>
</android.support.design.widget.AppBarLayout>
<android.support.v4.view.ViewPager
android:id="@+id/viewpager"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:layout_behavior="@string/appbar_scrolling_view_behavior" />
<android.support.design.widget.FloatingActionButton
android:id="@+id/floatingButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="bottom|end"
android:layout_margin="@dimen/fab_margin"
android:src="@drawable/ic_add" />
</android.support.design.widget.CoordinatorLayout>
Dies ist die XML-Datei Karte Ansicht ist
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:card_view="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<android.support.v7.widget.CardView
android:id="@+id/card_view"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_gravity="center"
android:layout_margin="3dp"
card_view:cardBackgroundColor="@color/cardview_light_background">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal">
<ImageView
android:id="@+id/thumbnail"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_margin="5dp"
android:layout_weight="1.5"
android:scaleType="fitCenter" />
<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="5"
android:layout_margin="5dp"
android:orientation="vertical">
<TextView
android:id="@+id/time_at"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="#616161"
android:textSize="20sp" />
<TextView
android:id="@+id/alarm_title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="#616161"
android:textSize="15sp"/>
<TextView
android:id="@+id/alarm_message"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="#616161"
android:textSize="15sp"/>
</LinearLayout>
<LinearLayout
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:layout_margin="5dp"
android:orientation="vertical">
<TextView
android:id="@+id/remaining_time"
android:layout_width="wrap_content"
android:layout_height="0dp"
android:layout_weight="2"
android:textSize="12sp"
android:textColor="#03A9F4"/>
<ImageView
android:id="@+id/overFlow"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="bottom|end"
android:src="@drawable/ic_more_vert"/>
</LinearLayout>
</LinearLayout>
</android.support.v7.widget.CardView>
</LinearLayout>
Und das ist das Fragment xml
<LinearLayout 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"
tools:context=".TodayFragment">
<RelativeLayout 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:background="#EEEEEE"
tools:context=".TodayFragment">
<android.support.v7.widget.RecyclerView
android:id="@+id/recycler_view_today"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:clipToPadding="false"
android:scrollbars="vertical" />
</RelativeLayout>
</LinearLayout>
Haben Sie die Antwort versucht –