2011-02-04 57 views

回答

1

有兩種可能的解決方案。

試着隱藏它,當焦點更改或當用戶點擊它:

uredittext.setOnClickListener(new OnClickListener() 
    onClick(View v) 
    { 
    InputMethodManager imm = (InputMethodManager)getSystemService(Context.INPUT_METHOD_SERVICE); 
    imm.hideSoftInputFromWindow(findViewById(R.id.uredittext).getWindowToken(), 0); 
    }); 

uredittext.setOnFocusChangeListener(new OnFocusChangeListener() 
    onFocusChange(View v, boolean hasFocus) 
    { 
    if(hasFocus) 
    { 
     InputMethodManager imm = (InputMethodManager)getSystemService(Context.INPUT_METHOD_SERVICE); 
     imm.hideSoftInputFromWindow(findViewById(R.id.uredittext).getWindowToken(), 0); 
     } 
    } 
);