2

Speziell auf Marshmallow (getestet auf Nexus 5X und 6P), wenn ich eine PopupWindow (die Match_Parent Breite und Höhe hat) über einen Bildschirm im immersiven Modus öffnen, Der Inhalt des Popups wird nicht auf den Vollbildmodus erweitert. Es gibt eine Lücke, in der sich die Navigationsschaltflächen befanden. Der Effekt ist so, als ob unsichtbare Navigationsknöpfe immer noch da wären und ein Leerzeichen/Lücke/Rand hinzufügen würden. DiesePopup-Fenster wird mit einem Leerzeichen/Lücke im Immersive-Modus angezeigt, nur auf Marshmallow

ist, wie ich das Popup erstellen:

PopupWindow popup = new PopupWindow(popupView, FrameLayout.LayoutParams.MATCH_PARENT, 
      FrameLayout.LayoutParams.MATCH_PARENT, false); 

popup.showAtLocation(activity.findViewById(R.id.full_screen_root_view), Gravity.CENTER, 0, 0); 

Dies ist der Anfang des Popup-Layouts:

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" 
    android:id="@+id/popup" 
    android:layout_width="match_parent" 
    android:layout_height="match_parent" 
    android:orientation="vertical" 
    android:gravity="center" 
    android:background="#AA000000"> 

Dies ist die Vollbild-Ansicht, in dem Pop-up angezeigt wird:

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" 
    android:layout_width="match_parent" 
    android:layout_height="match_parent" 
    android:orientation="vertical" 
    android:id="@+id/full_screen_root_view" 
    android:background="@android:color/black"> 

Wissen Sie, ob sich etwas mit Marshmallow geändert hat, das diesen Fehler speziell verursachen würde? Alles funktioniert gut in einem Nexus 5, mit Version 5.0.1 und anderen älteren Handys/Versionen, die ich getestet habe. Vielen Dank im Voraus! :)

+0

Können Sie auch mit diesem Verhalten einen Screenshot posten? – azizbekian

+0

Es ist eine Weile her, dass ich diesen Beitrag erstellt habe und ich habe keinen Screenshot mehr. Zu der Zeit habe ich wegen dieses Problems kein 'PopupWindow' verwendet. Stattdessen hatte ich eine "Ansicht" im XML-Layout und animierte sie für einen schönen visuellen Effekt verschwinden und erscheinen. – Marilia

Antwort

0

Ich habe dieses Problem vor. Ich habe das Problem gelöst, indem ich PopupWindow auf "false" gesetzt habe, bevor "show" angezeigt wird.

PopupWindow mWindow = new PopupWindow(context); 
mWindow.setFocusable(false); 
mWindow.showAtLocation(anchor, Gravity.NO_GRAVITY, xPos, yPos); 
0

können Sie dies versuchen.

Popup-Fensterhintergrund einziehbar festlegen.

ColorDrawable colorDrawable = new ColorDrawable(Color.WHITE); 
setBackgroundDrawable(colorDrawable); 
0

ich mit Gravity.FILL_VERTICAL aufgelöst

popup.showAtLocation(activity.findViewById(R.id.full_screen_root_view), Gravity.FILL_VERTICAL, 0, 0);