我知道这个问题已被问过百万次,但无论我使用哪种方法对我都不好.
如果我使用
android:theme="@android:style/Theme.NoTitleBar"
Run Code Online (Sandbox Code Playgroud)
在清单文件中,应用程序的整个主题发生了变化.如果我放
requestWindowFeature(Window.FEATURE_NO_TITLE);
Run Code Online (Sandbox Code Playgroud)
在onCreate活动中,它会在启动应用程序时很快显示出来.
顺便说一下,我没有选择任何主题,只使用标准的android.
因此,如果在 edittext gotovinaEdit 中按下 Enter 键,我想将焦点切换到 edittext karticeEdit。到目前为止,这是我的代码,但它不起作用
final EditText gotovinaEdit = (EditText) vieww.findViewById(R.id.gotovinaEdit);
final EditText karticeEdit = (EditText) vieww.findViewById(R.id.karticeEdit);
gotovinaEdit.setOnKeyListener(new View.OnKeyListener() {
@Override
public boolean onKey(View view, int i, KeyEvent keyEvent) {
if ((keyEvent.getAction() == KeyEvent.ACTION_DOWN) && (i == KeyEvent.KEYCODE_ENTER)) {
gotovinaEdit.clearFocus();
karticeEdit.requestFocus();
return true;
}
return false;
}
});
Run Code Online (Sandbox Code Playgroud)
编辑:弄清楚了,只需添加 android:singleLine="true",希望这对某人有帮助