Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Hide ImageView when keyboard appears, and show it when keyboard disappear

How can i hide ImageView when keyboard appears (after pressing on some EditText). And then show this ImageView when keyboard is dismissed?

like image 370
Procurares Avatar asked Mar 18 '13 15:03

Procurares


1 Answers

I think OnFocusChangeListener might be the right thing for you.

editText.setOnFocusChangeListener(new OnFocusChangeListener() {

    @Override
    public void onFocusChange(View v, boolean hasFocus) {
        // view/hide ImageView
    }
});
like image 80
poitroae Avatar answered Oct 30 '22 01:10

poitroae