我有一个带有三个 EditText 的屏幕,其中一个,第一个,在屏幕顶部,当我单击它时不会调用键盘。我没有使用 AVD,我使用的是自己的设备,并在其他设备上进行了测试,结果相同。
我将把屏幕和 xml 代码放在这里...... EditTexts 之间没有什么不同,只是位置。要在该 EditText 中进行输入,我需要选择上面的 EditText 之一,然后出现键盘。至少当我再次选择第一个 EditText 时它不会隐藏。我已经尝试过 setFocus(true) 并没有解决我的问题。请帮我!
XML
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/background"
android:paddingBottom="@dimen/activity_vertical_margin"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
tools:context=".SaldoCadastro" >
<TextView
android:id="@+id/tvTituloReg"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:text="Saldo Banco"
android:textAppearance="?android:attr/textAppearanceLarge" />
<TextView
android:id="@+id/tvErroSenha1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_below="@+id/tvTituloReg"
android:layout_marginTop="17dp"
android:text="Insert on the field below how much you have in your bank." />
<TextView
android:id="@+id/textView2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignLeft="@+id/tvErroSenha1"
android:layout_below="@+id/tvErroSenha1"
android:layout_marginTop="41dp"
android:text="Insert on the field below how much is your credit card limit." />
<EditText
android:id="@+id/etSaldo"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_below="@+id/tvErroSenha1"
android:ems="10"
android:inputType="numberDecimal" >
<requestFocus />
</EditText>
<EditText
android:id="@+id/etCartaoLimite"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignLeft="@+id/textView2"
android:layout_below="@+id/textView2"
android:ems="10"
android:inputType="numberDecimal" />
<TextView
android:id="@+id/textView3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignLeft="@+id/etCartaoLimite"
android:layout_below="@+id/etCartaoLimite"
android:text="About your credt card how much you've spent already." />
<EditText
android:id="@+id/etCartao"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignLeft="@+id/textView3"
android:layout_below="@+id/textView3"
android:ems="10"
android:inputType="numberDecimal" />
<Button
android:id="@+id/btRegisterSaldo"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignLeft="@+id/etCartao"
android:layout_below="@+id/etCartao"
android:layout_marginLeft="14dp"
android:text="Register" />