简体   繁体   中英

Android colors don't work on my physical device

I've been trying to figure out what's wrong with my app/XML code without any success. I've tried everything in my book, even went to the IRC and they told me that they haven't seen anything like it. I'm using the following code to create TWO ( 2 ) TextViews who are 60% transparent black.

<TextView
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:text="Forgot your password?"
    android:id="@+id/tvForgotPassword"
    android:textColor="#99000000"
    android:layout_weight="1"
    android:gravity="center_horizontal"
    android:background="#00FFFFFF"/>
<TextView
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:text="Sign up now!"
    android:id="@+id/tvSignUp"
    android:layout_weight="1"
    android:gravity="center_horizontal"
    android:textColor="#99000000"
    android:background="#00FFFFFF"/>

As you can see, all I'm trying to do is create two simple TextViews saying "Sign up now!" & "Forgot your password?" who're colored #99000000 (Black, 60% transparent).

The result in the android view/virtual machine looks great :

应用程序的虚拟机/ XML视图。

This is EXACTLY what I was aiming for. BUT, when I run my app on my physical device, it looks like this.

有问题的应用程序的物理设备屏幕截图。

As you can see, they're not identical. I have tried playing around with the XML, editor without avail. I just can't get it to work. I asked my friends, read trough the documentation, asked people on the IRC and nobody knows what it is.

I might have overlooked something, if so, could anyone point me towards the right direction?

Thank you for reading my question!

After hours and hours and HOURS of frustration, I have found the wrong-doer here. I snatched my sister's galaxy s5 and it actually worked on her android device. This confirmed the fact that something was wrong with my device.

Now, for some reason, certain options were enabled by default ( BETA options ). Which option you ask? This guy :

选项一

It was turned on by default. Turned it off and everything worked. Now, I hope that this helps people in the future, looking at the exact same problem I was facing this morning. It would be wise for another person with a nexus-5 to look and see if this was enabled by default too ( on their device ).

Thanks to everybody for the edits/tips! Have a great, great day people of stackoverflow!

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM