Android How to adjust layout in Full Screen Mode when softkeyboard is visible

前端 未结 25 2131
后悔当初
后悔当初 2020-11-22 03:56

I have researched a lot to adjust the layout when softkeyboard is active and I have successfully implemented it but the problem comes when I use android:theme=\"@andro

25条回答
  •  时光取名叫无心
    2020-11-22 04:37

    Thank you Joseph for your answer. However, in the method possiblyResizeChildOfContent(), the portion

    else {
                // keyboard probably just became hidden
                frameLayoutParams.height = usableHeightSansKeyboard;
            }
    

    was not working for me, as the lower portion of view became hidden. So I had to take a global variable restoreHeight, and in the constructor, I inserted the last line

    restoreHeight = frameLayoutParams.height;
    

    and then I replaced the former mentioned part with

    else {
                // keyboard probably just became hidden
                frameLayoutParams.height = restoreHeight;
            }
    

    But I have no idea why your code didn't work for me. It would be of great help, if someone can shed light on this.

提交回复
热议问题