如何避免软键盘推高了我的布局?我的、高了、布局、键盘

2023-09-12 04:06:40 作者:清酒共友

我有一组导航按钮坐在每一个活动的底部。在一些活动,我需要在它的顶部搜索的TextView。然而,只要在TextView的用户类型的东西,软键盘总是向上推我的导航按钮,即使它实际上并不阻止TextView的。这让我的用户界面看起来很滑稽。我怎么能强迫我的导航按钮留静态的,他们是永远不会被推挤的软键盘?我试图设置活动的windowSoftInputMode,但没有配置帮助。

I have a set of navigation buttons sitting at the bottom of each Activity. In some activities, I need a search textview at the top of it. However, whenever the user types something in the textview, the soft keyboard always pushes up my navigation buttons, even though it doesn't actually block the textview. It makes my UI looks funny. How can I force my navigation buttons to stay static where they are without ever being pushed by the soft keyboard? I have tried to set the Activity's windowSoftInputMode, but none of the configurations help.

有什么建议? 谢谢

推荐答案

我也有我加了同样的问题,在第一个

I did have the same problem and at first I added

  <activity
    android:name="com.companyname.applicationname"
    android:windowSoftInputMode="adjustPan">

我的清单文件。但仅此并没有解决问题。然后,所提到的阿尔乔姆Russakovskii我加入

to my manifest file. But this alone did not solve the issue. Then as mentioned by Artem Russakovskii I added

 <ScrollView
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:isScrollContainer="false">

 </ScrollView>

在滚动视图。

这是为我工作。

 
精彩推荐
图片推荐