0

I'm a newbie in Android development. Recently I have been facing a problem in the EditTexts(eventhough I havent changed any attributes of EditText) used in my app which I'm currently running in Emulator. On clicking the EditText it receives focus, but on typing something the focus changes to some other view. But I'm able to enter values if I navigate to EditText using Tab button of the keyboard. This happens to all EditTexts in my application. Surfed net for getting a solution, but did not find one.Help...

Implementation of one of my EditText:

<EditText                   
    android:id="@+id/edittext_testname"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:ems="10"
    android:hint="@string/hintEditText1"/>

Thanks in advance.

4

2 に答える 2

0

物理デバイスでアプリを試したことがありますか?

ただし、EditText xml に問題はありません。その EditText に関連するイベントをキャッチする Java コードがアクティビティにあるのではないでしょうか? それとも、あなたが言及した他のビュー要素に焦点を当てるのでしょうか?

于 2013-03-22T08:55:12.227 に答える
0

同様の問題がありましたが、EditText に定義したカスタム スタイルを使用していました。どのように修正しましたか?

<item name="android:focusable">true</item> <item name="android:focusableInTouchMode">true</item>

したがって、「android:focusable」および「android:focusableInTouchMode」プロパティを適用してみて、違いが生じるかどうかを確認してください。デフォルトで EditText に適用する必要がありますが、試してみてください。

(これをコメントとして投稿したはずですが、もっと担当者が必要です)

于 2015-07-18T09:20:35.870 に答える