Android 용 사용자 정의 키보드를 설계하고 있습니다. 내 응용 프로그램의 일부 필드에 대해 Enter 키에 대한 사용자 지정 레이블을 갖고 싶습니다. 필자는 키보드 개발을 위해 샘플 SoftKeyboard 프로젝트를 사용했습니다. 지금까지 시도 무엇 : 내 활동 중 하나에서 1 나는 다음과 같은 속성을 가진 글고이 : 나는 네이티브 안드로이드 키보드를 사용하는 경우Android에서 사용자 정의 키보드의 Enter 키 레이블을 변경할 수 없습니다.
<EditText
android:id="@+id/password"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:imeActionId="@+id/action_sign_in"
android:imeActionLabel="@string/sign_in"
android:inputType="textPassword" />
는 내 입력 키를하지만, 경우 "로그인"이 표시 I
void setImeOptions(Resources res, int options)
{
if (mEnterKey == null)
{
return;
}
switch (options & (EditorInfo.IME_MASK_ACTION | EditorInfo.IME_FLAG_NO_ENTER_ACTION))
{
case EditorInfo.IME_ACTION_GO:
mEnterKey.iconPreview = null;
mEnterKey.icon = null;
mEnterKey.label = res.getText(R.string.label_send_key);
break;
case EditorInfo.IME_ACTION_NEXT:
mEnterKey.iconPreview = null;
mEnterKey.icon = null;
mEnterKey.label = res.getText(R.string.label_next_key);
break;
case EditorInfo.IME_ACTION_SEARCH:
mEnterKey.icon = res.getDrawable(R.drawable.sym_keyboard_search);
mEnterKey.label = null;
break;
case EditorInfo.IME_ACTION_SEND:
mEnterKey.iconPreview = null;
mEnterKey.icon = null;
mEnterKey.label = res.getText(R.string.label_send_key);
break;
case R.id.action_sign_in:
mEnterKey.iconPreview = null;
mEnterKey.icon = null;
mEnterKey.label = res.getText(R.string.sign_in);
break;
default:
mEnterKey.label = res.getText(R.string.label_send_key);
mEnterKey.icon = null;
break;
}
}
}
LatinKeyboard.java에서 누군가가 나이 문제를 해결하는 데 도움이 될 수 있다면 감사하겠습니다 : 그것은 다음 문에 키를 입력의 기본 값을 보여줍니다 내 사용자 정의 키보드를 사용합니다.