简体   繁体   English

使用键盘滚动屏幕时显示自定义工具栏

[英]Show Custom Toolbar while Scrolling Screen with Keyboard

Please read the question carefully before any action, 请采取任何措施前仔细阅读问题,

I am using the custom toolbar in my android application with one image, one button, and title. 我在Android应用程序中使用自定义工具栏,其中包含一张图片,一个按钮和标题。

Now below that, I have a full screen with edit texts and text views and buttons. 在此之下,我有一个全屏,其中包含编辑文本以及文本视图和按钮。 While I am trying to fill data and keyboard is open at that time while I am scroll down my screen upside, it hides toolbar also, even toolbar is outside of scroll. 当我尝试填充数据并且当时我向下滚动屏幕时,键盘处于打开状态时,它也隐藏了工具栏,即使工具栏不在滚动范围内。

I have taken scrollbar inside the body view, not for the whole screen, but then also while I am scrolling it hides the toolbar. 我已经在主体视图中使用了滚动条,不是针对整个屏幕,而是在滚动时还隐藏了工具栏。

Try this in manifest file it may work. 在清单文件中尝试此操作可能会起作用。

<activity
        android:name=".YourActivity"
        android:screenOrientation="portrait"
        android:windowSoftInputMode="adjustResize" />

Use in your activity tag in Manifest file 在清单文件中的活动标签中使用

<activity android:windowSoftInputMode="adjustResize"> </activity>

The activity's main window is always resized to make room for the soft keyboard on the screen. 活动的主窗口始终会调整大小,以便为屏幕上的软键盘腾出空间。

Moreover, you can find the detail about it here official doc 此外,您可以在此处找到有关此文档的详细信息

Also, look at this question 另外,看看这个问题

Hope it will be helpful to you. 希望对您有帮助。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM