Why my EditText copy/paste menu is under the EditText? How change the z-order of popup window?

后端 未结 4 1650
孤独总比滥情好
孤独总比滥情好 2021-02-07 10:45

NOTE

If someone know how to order (z-order) Windows added via windowmanager, i will also accept the answer because it\'s will answer al

相关标签:
4条回答
  • 2021-02-07 11:06

    This is expected, if you see the documentation of DecorView, It give you the background of current view.

    What you are doing is starting the action bar on the decorview, hence its coming in background. Read this article for more detail http://www.curious-creature.com/2009/03/04/speed-up-your-android-ui/

    To solve this issue, you need to get the current view, for which you may use View focusedView = (View) yourParentView.getFocusedChild();

    0 讨论(0)
  • 2021-02-07 11:10

    Their is actually no way to order (z-order) windows added via windowmanager. The only way is to remove the window and to add it back again.

    0 讨论(0)
  • 2021-02-07 11:16

    Try WindowManager.LayoutParams.TYPE_SYSTEM_ALERT;

    instead of WindowManager.LayoutParams.TYPE_APPLICATION;

    0 讨论(0)
  • 2021-02-07 11:27

    It's may help you, try it.

    The key answer is android:windowActionModeOverlay

    in res/style.xml define a new theme extends your original theme:

    <?xml version="1.0" encoding="utf-8"?>
    <resources>
      <style name="Theme.Black.NoTitleBar.ActionModeOverlay"
      parent="android:Theme.Black.NoTitleBar">
        <item name="android:windowActionModeOverlay">true</item>
      </style>
    </resources>
    

    or just add a line true in your theme if you have already defined one.

    Make your Activity use the theme defined above in AndroidManifest.xml:

    <activity
        android:name="you.AppActivity"
        android:theme="@style/ActionModeOverlay" >
    
    0 讨论(0)
提交回复
热议问题