5

我需要在GLSurfaceViewaFrameLayout中添加 a PopupWindow。问题是,在内部,SurfaceView从当前窗口请求令牌。PopupWindows没有自己的令牌,所以我给它弹出父级的令牌,如下所示:

class MySurfaceView extends GLSurfaceView {
   ...
  @Override
  public IBinder getWindowToken() {
      // I set the mPopupParent manually to be the parent of the PopupWindow in question
      return mPopupParent.getWindowToken();
    }
  }
  ...
}

现在,即使MySurfaceView添加到 aFrameLayoutPopupWindow,它也不会在那里绘制。它借鉴了我从中获得令牌的观点。

我怎样才能让它在它实际添加到的布局上绘制?

编辑:只是为了提供更多细节,以防万一,mPopupParent 是一个 IME 视图(本质上是一个键盘)。

4

1 回答 1

0
I got something just like yours,and finally these ways work out:

一个 。使用对话框

B. 使用 android.view.WindowManager

于 2013-09-25T12:58:03.953 回答