最近忙于自媒体事业不能自拔,已经很久没有写技术博客了。之所以写是因为这个非常的重要,也非常的好用。先上一张完美的效果图。
//监听键盘展开 、收起
private void listenerKeyBoard() {
getWindow().getDecorView().addOnLayoutChangeListener(new View.OnLayoutChangeListener() {
@Override
public void onLayoutChange(View v, int left, int top, int right,
int bottom, int oldLeft, int oldTop, int oldRight, int oldBottom) {
//当页面布局发生变化的时候调用
YetuLog.e("onLayoutChange", "onLayoutChange: " + "调用");