简体   繁体   English

软键盘全屏显示时如何保留标题?

[英]How to keep header when the soft keyboard comes in with full screen?

I have a header on a chat that move up every time you click on EditText, and disappear, 我有一个聊天标题,每当您单击EditText时,标题就会上移,然后消失,

To fix this problem, I added on Oncreate this 为了解决这个问题,我在Oncreate上添加了

getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_RESIZE);

that works perfect, but when I add this one UIt doesnt work 效果很好,但是当我添加此UIt时不起作用

getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,WindowManager.LayoutParams.FLAG_FULLSCREEN);

That line make the activity full screen, I tryed to add in the manifest instead but It doesnt work, It sound like if you use one, you cant use the other... 那条线使活动全屏显示,我尝试添加清单,但它不起作用,听起来像如果您使用其中一个,则无法使用其他...

Any ideas how to solve this? 任何想法如何解决这个问题?

PD: I tested with adjustPan, and some many things... PD:我用adjustPan进行了测试,还有很多其他方面……

Please Edit your Manifest.xml file and add this to your Chat Activity's Tag: 请编辑您的Manifest.xml文件,并将其添加到聊天活动的标签中:

<activity
 android:theme="@android:style/Theme.NoTitleBar.Fullscreen" >
 ...
</activity>


By using this, you will not need to use getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,WindowManager.LayoutParams.FLAG_FULLSCREEN); 通过使用此方法,您将不需要使用getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,WindowManager.LayoutParams.FLAG_FULLSCREEN); and this will solve your problem. 这将解决您的问题。

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

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