I’m not able to figure out a really stupid issue about TextView!!
I have a simple Layout with a Button and a TextView. This is the Layout:
<Button
android:id="@+id/button1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:text="Button1" />
<TextView
android:id="@+id/textView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_below="@+id/button1"
android:focusable="true"
android:clickable="true"
android:text="TextView1"
android:textAppearance="?android:attr/textAppearanceMedium"/>
When the Button has focus and i press the “down arrow” in Emulator the TextView doesn’t get the focus (it doesn’t turn blue!!) Why? Please help me!!
Despite the TextView doesn’t turn blue, it is getting focus.
To see the focus/unfocus happening, you can, for instance, define a color change in the text. This way, these events are perceptive to the user.
Create a .xml file and put into /res/color/
In my case, i named the file as “color_text_view.xml”.
And add the
android:textColor="@color/color_text_view"to the textview.Hope this help!