Android EditText text color auto changing during typing
while typing into EditText, text color automatically changing from black to white, initially i set the text color to white and set hint color also white, but when testing it, it shows typing in black color on start but while in mid or reach to a random number of characters, it turns to white text. its working fine Samsung Galaxy Gio, Nexus One and on different emulators but on HTC Evo 3G and some other devices, its showing this behavior! I tried to fix by setting style to normal, text color to white, hint color to white and other things relating to focus etc, everything is set to white but still on some devices it is showing the behavior and continues to changing color in mid of typing. Please let me know if someone is familiar with this and fixed any issue like this.
Here is the video demonstrating the issue. http://youtu.be/1dydBvZnSHI
Here is my xml for this EditText
<EditText
android:id="@+id/email_edittext"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_marginRight="15dp"
android:layout_marginTop="5dp"
android:layout_toRightOf="@+id/textView2"
android:background="@drawable/share_email_bg"
android:ems="10"
android:lines="1"
android:maxLines="1"
android:padding="5dip"
android:singleLine="true"
android:textColor="#ffffff"
android:textColorHint="#ffffff"
android:inputType="textEmailAddress"/>
Well I am answering this because some may get benefit out of this. Actually I got the same problem in one of my device and after a long struggle I found that its a very silly mistake.
To solve this we just need to add one attribute in the <EditText>
node. Here is the solution :
<EditText
android:textColor="@android:color/black"
..........
/>
链接地址: http://www.djcxy.com/p/87328.html
上一篇: 为什么黑色以外的结果的平均颜色屈服?