Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/186.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Android 覆盖中的平移键盘_Android - Fatal编程技术网

Android 覆盖中的平移键盘

Android 覆盖中的平移键盘,android,Android,我有一个Android应用程序,它在启动时向窗口添加一个视图。“我的视图”显示正确,但每当我打开键盘时,我的视图都会调整大小,使其位于屏幕顶部和键盘顶部之间。我已尝试将softInputMode设置为SOFT\u INPUT\u ADJUST\u PAN,但这没有任何作用。事实上,把它改成任何东西似乎都没有效果 我的限制是: 我必须将视图显示为覆盖图(使用WindowManager.addView()) 我必须使用TYPE\u电话 到目前为止,我的代码是: public Displa

我有一个Android应用程序,它在启动时向窗口添加一个视图。“我的视图”显示正确,但每当我打开键盘时,我的视图都会调整大小,使其位于屏幕顶部和键盘顶部之间。我已尝试将
softInputMode
设置为
SOFT\u INPUT\u ADJUST\u PAN
,但这没有任何作用。事实上,把它改成任何东西似乎都没有效果

我的限制是:

  • 我必须将视图显示为覆盖图(使用
    WindowManager.addView()
  • 我必须使用
    TYPE\u电话
到目前为止,我的代码是:

    public DisplayManager(Context context) {
        this.context = context;
        this.windowManager = (WindowManager) this.context.getSystemService(Context.WINDOW_SERVICE);
        this.isDisplayed = false;

        this.layoutParameters = new WindowManager.LayoutParams(WindowManager.LayoutParams.TYPE_PHONE);
        /*this.layoutParameters.width = WindowManager.LayoutParams.MATCH_PARENT;
        this.layoutParameters.height = WindowManager.LayoutParams.MATCH_PARENT;*/
        this.layoutParameters.flags = WindowManager.LayoutParams.FLAG_FORCE_NOT_FULLSCREEN;
        this.layoutParameters.format = PixelFormat.TRANSLUCENT;
        this.layoutParameters.softInputMode = WindowManager.LayoutParams.SOFT_INPUT_ADJUST_PAN;
    }

    public void show() {
        if (this.isDisplayed == false) {
            if (this.mainView == null)
                this.mainView = MainView_.build(this.context);

            this.windowManager.addView(this.mainView, this.layoutParameters);
            this.mainView.viewDisplayed();
            this.isDisplayed = true;
        }
    }

也许这会有帮助,谢谢@ElliotSchep,那里有一些很好的信息,但没有什么特别有助于解决我面临的这个问题