0
我正在使用alertDialog v7創建我的自定義對話框。 在我的自定義視圖內我有editType「phone | numberPassword」的editText。 但是當我嘗試輸入一些文字這種情況下 - 這是不工作,意味着EDITTEXT不顯示任何改變,任何新的符號......EditText在AlertDialog v7中不起作用
這裏是我的alertDialog自定義視圖:
<LinearLayout
android:id="@+id/ll_login_regLayout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:visibility="visible"
android:paddingRight="@dimen/dialog_padding"
android:paddingLeft="@dimen/dialog_padding"
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto">
<EditText
android:id="@+id/et_p1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:inputType="phone|numberPassword"
/>
</LinearLayout>
我這裏是我的代碼片段裏面:
private void showSetPassDialog(){
AlertDialog.Builder builder = new AlertDialog.Builder(getActivity());
View dialogView = LayoutInflater.from(getActivity()).inflate(R.layout.dialog_register_pass, null);
builder.setView(dialogView);
builder.setPositiveButton(getString(R.string.text_dialogpsw_btn_ok_password),
new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
if (!chb.isChecked()) {
String mess = getString(R.string.error_check_dogovor);
SU_Tools.showToast(getActivity(), mess);
showSetPassDialog();
} else {
mMainLayout.setVisibility(View.VISIBLE);
}
}
});
builder.show();
}
*我嘗試鍵入一些文本 - 這是行不通的... *是什麼意思? – Blackbelt
editText不顯示任何更改 –