작동하지 :안드로이드 대해서는 imeOptions = "actionDone"나는 안드로이드 앱의 로그인 화면을 얻으려고 노력하고 있고 지금까지 내 코드입니다
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<LinearLayout
android:id="@+id/linearLayout1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:orientation="vertical">
<EditText
android:id="@+id/username"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="Username"
android:inputType="text"
android:singleLine="true"
android:imeOptions="actionNext">
<requestFocus />
</EditText>
<EditText
android:id="@+id/password"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="Password"
android:inputType="textPassword"
android:singleLine="true"
android:imeOptions="actionDone" />
<Button
android:id="@+id/buttonLaunchTriage"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"
android:text="@string/login" />
</LinearLayout>
</RelativeLayout>
내가 그것을 실행하려고 키보드 오른쪽을 보여줍니다 키를 입력했지만 암호를 입력 한 후에 완료를 시도하면 아무 일도 일어나지 않습니다. 이 버튼을 처리하기 위해 이것을 사용하고 있습니다 :
private void setupLoginButton() {
Button launchButton = (Button) findViewById(R.id.buttonLaunchTriage);
launchButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
EditText username = (EditText) findViewById(R.id.patient_start_userName_value);
EditText password = (EditText) findViewById(R.id.patient_start_password_value);
try {
if(TriageApplicationMain.validateUser(username.getText().toString(),password.getText().toString(),getApplicationContext()))
{
Toast.makeText(StartActivity.this,
"Launching Triage Application", Toast.LENGTH_SHORT)
.show();
startActivity(new Intent(StartActivity.this, MainActivity.class));
}
else
{
AlertDialog.Builder alertDialogBuilder = new AlertDialog.Builder(
StartActivity.this);
// set dialog message
alertDialogBuilder
.setMessage("Incorrect Credentials")
.setCancelable(false)
.setPositiveButton("OK",new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog,int id) {
// if this button is clicked, close
// current activity
dialog.cancel();
}
});
// create alert dialog
AlertDialog alertDialog = alertDialogBuilder.create();
// show it
alertDialog.show();
}
}
catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
});
}
나는 많은 코드를 알고 있지만, 누군가가 나를 도와 줄 수 있다면 좋을 것입니다. 이것은 학교 프로젝트를위한 것입니다.
추신 : 나는 이것을 게시하기 전에 Google을 통해 단호한 시간을 검색했습니다. 그렇게하지 않으면 비판하지 마십시오. 유용하다고 생각되는 링크를 찾으면 공유하십시오.
? 키보드 자체를 숨기거나 로그인을 진행 하시겠습니까? – waqaslam
나는 동일한 문제에 직면 해 있습니다. 추가 할 내용은 다음과 같습니다. android : imeActionLabel = "완료" android : singleLine = "true" 여기에 대한 답변은 입니다. http://stackoverflow.com/questions/5578991/actiondone -imeoption-doesnt-work-on-edittext-in-android-2-3/5579944 # 5579944 –