//這裡flChat為聊天資訊展示RecyclerView所在的根布局
FrameLayout flChat = (FrameLayout) findViewById(R.id.fl_chat);
flChat.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) {
if (bottom < oldBottom) {
//通過RecyclerView的滾動方法将聊天資訊滾動到最後一條
rvChat.scrollToPosition(adapterChat.getModels().size() - );
}
}
});