samedi 23 juillet 2016

ScrollView steals focus when scrolling

I am trying to make a chatting window. There's a TextView wrapped in a ScrollView in the upper side of the screen; and a EditText in the bottom of the screen. I use following code to make the ScrollView scroll automatically when the new message is out of view.

scroll.post(new Runnable(){
@Override
public void run() {
       scroll.fullScroll(View.FOCUS_DOWN);
}
});

Something annoying is when the ScrollView scrolls, it steals my focus from the EditText. I can't input my message when the ScrollView is scrolling. Can anybody give me some light? Thanks a lot : )

Aucun commentaire:

Enregistrer un commentaire