问题描述
我有一个愚蠢的问题,请按照下面的图片进行操作
i have silly problem please follow the below pics
当我点击输入电子邮件时,它看到如下图,
and when i clicked on enter email it saw like below pic,
尽管使用 android:windowsoftinputmode="adjustpan" android lollipop 主题和工具栏,问题还是出现了,
now the problems are coming inspite of using android:windowsoftinputmode="adjustpan" android lollipop theme and toolbar,
- 图片变小了.
- 电子邮件编辑文本应该显示在键盘上方,但它没有.
提出一些百家乐凯发k8的解决方案.
推荐答案
首先确保您在 xml 布局中提供了 scrollview.
first of all make sure you have provided a scrollview in your xml layout.
... ...
然后在你的 activity 中确保你正在做这样的事情(这段代码只是为了演示在哪里使用 getwindow().setsoftinputmode(windowmanager.layoutparams.soft_input_state_hidden);):
then inside your activity make sure you are doing something like this(this code is just to demonstrate where to use getwindow().setsoftinputmode(windowmanager.layoutparams.soft_input_state_hidden);) :
public void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.temp); getwindow().setsoftinputmode(windowmanager.layoutparams.soft_input_state_hidden); final edittext time = (edittext)findviewbyid(r.id.timeet); time.setontouchlistener(new ontouchlistener() { public boolean ontouch(view v, motionevent event) { time.requestlayout(); myactivity.this.getwindow().setsoftinputmode(windowmanager.layoutparams.soft_input_adjust_unspecified); return false; } }); final edittext date = (edittext)findviewbyid(r.id.dateet); date.setontouchlistener(new ontouchlistener() { public boolean ontouch(view v, motionevent event) { date.requestlayout(); myactivity.this.getwindow().setsoftinputmode(windowmanager.layoutparams.soft_input_adjust_unspecified); return false; } }); }