我有兩個EditText上txtPassword,txtEmail基於單選按鈕更改事件我只是隱藏和顯示txtPassword場 我只想porgrammatic改變ImeOptions爲我寫下面的代碼 的Android imeOptions變化綱領性
txtPassword.setImeOptions(EditorInfo.IME_ACTION_DONE);
txtEmail.setImeOptions(EditorInfo.IME_ACTION_NEXT);
,但是這是行不通的。當我觀察軟鍵盤時,這表明我在txtEmail中完成了操作(僅僅是因爲在無線電改變之前,只有txtEmail可見,所以自動完成) 但是在密碼字段中手動設置密碼後,如果我觀察帶有電子郵件字段的軟鍵盤,用下一個選項改變它。我只想如果一個txtEmail比它已經做了imeOptions可見,並且如果txtPassword,txtEmail都可見比txtEmail接下來ImeOptions和txtPassword它有顯示完成imeOptions。提前致謝。
編輯:
radiologin.setOnCheckedChangeListener(new OnCheckedChangeListener() {
public void onCheckedChanged(RadioGroup group,int checkedId) {
// checkedId is the RadioButton selected
if (checkedId == R.id.radioWithoutPassword) {
txtPassword.setVisibility(View.GONE);
txtEmail.setBackgroundDrawable(getResources().getDrawable(R.drawable.both_corner));
txtEmail.setImeOptions(EditorInfo.IME_ACTION_DONE);
}
else
{
txtEmail.setImeOptions(EditorInfo.IME_ACTION_NEXT);
txtPassword.setImeOptions(EditorInfo.IME_ACTION_DONE);
txtPassword.setVisibility(View.VISIBLE);
txtEmail.setBackgroundDrawable(getResources().getDrawable(R.drawable.top_corner));
}
}
});
可能的重複http://stackoverflow.com/questions/3459168/imeoptions-actionnext-programmatically-how-to-jump-to-下一個字段 –
可能的重複http://stackoverflow.com/questions/2004344/how-do-i-handle-imeoptions-done-button-click –