我有一个占据屏幕上半部分的表单,我想显示键盘 总是在下半部分。我该怎么做?
(Android 2.1,NexusOne)
答案 0 :(得分:4)
如果要控制代码中的软键盘,可以使用InputMethodManager调用它并将其关闭。 getSystemService()是对Activity的调用。
InputMethodManager imm = (InputMethodManager)getSystemService(Context.INPUT_METHOD_SERVICE);
imm.showSoftInput(activeView, 0);
答案 1 :(得分:2)
尝试<activity android:windowSoftInputMode="stateAlwaysVisible">
有关详细信息,请参阅this page
答案 2 :(得分:0)
尝试查看v = getWindow()。getDecorView();