软键盘弹起问题
作者:
geaosu | 来源:发表于
2019-07-27 21:13 被阅读0次
mRoot = getActivity().getWindow().getDecorView();
mRoot.getViewTreeObserver().addOnGlobalLayoutListener(new ViewTreeObserver.OnGlobalLayoutListener() {
@Override
public void onGlobalLayout() {
Rect rect = new Rect();
mRoot.getWindowVisibleDisplayFrame(rect);
int rootInvisibleHeight = mRoot.getRootView().getHeight()-rect.bottom;
if(rootInvisibleHeight>100){
//显示
footerView.setVisibility(View.GONE);
}else{
//隐藏
footerView.setVisibility(View.VISIBLE);
}
}
});
本文标题:软键盘弹起问题
本文链接:https://www.haomeiwen.com/subject/eskyrctx.html
网友评论