如何在键盘弹出时冻结列表视图滚动,然后在隐藏键盘后重新获得滚动。 我似乎无法从任何地方开始
答案 0 :(得分:0)
在On ScrollState中,更改检查键盘是否打开:
public void onScrollStateChanged(AbsListView view, int scrollState) {
//check keyboard is open?
InputMethodManager imm = (InputMethodManager) getActivity()
.getSystemService(Context.INPUT_METHOD_SERVICE);
if (imm.isAcceptingText()) {
writeToLog("Software Keyboard was shown");
} else {
writeToLog("Software Keyboard was not shown");
}
}
并使用
停止列表视图 listView.setScrollContainer(false);