即時通信發消息出現ListView左邊視圖忽然閃現,再加載右邊視圖的bug


剛開始發送一條消息是這樣處理的:it

conversation.addMessage(message);
listView.setAdapter(adapter);
adapter.refreshSelectLast();io

使得ListView刷新了2次,其中listView.setAdapter(adapter);使得列表從第一個item從新加載,也就是那個突閃的視圖,ast

adapter.refreshSelectLast();是刷新最後一個item,知道問題所在,就找到解決方案了。List

解決辦法就是將listView.setAdapter(adapter)刪除便可。
rsa

相關文章
相關標籤/搜索