简体   繁体   中英

Xamarin Android - white text in TextView appears gray not white

I am using a TextView and specifying the text to be white, but it always shows up gray both in the VS preview window and on the device.

Why is this and what needs to change to make it show white?

    <LinearLayout
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:layout_alignParentTop="true"
    android:layout_marginTop="10dp"
    >
    <TextView

        android:id="@+id/textviewLatLonEtc"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:gravity="center_horizontal"
        android:layout_gravity="top"
        android:background="#00000000"
        android:textColor="#FFFFFFFF"
        android:textAppearance="?android:attr/textAppearanceSmall"
        android:text="UTC Latitude Longitude Altitude Grid HorizontalVariance"



    />
 </LinearLayout>

Note - I did notice that if I made the ending LinearLayout tag misspelled, for example /Blah, that the Visual Studio preview window then displayed the text as white, not gray.

Is some weird setting getting inherited too much ? Looking forward for a solution to this.

OK, oops, found the problem. After reconstructing my page piece by piece, I found out that I had a secondary View with transparency of #80000000 (half transparency) so half the value was getting through.

I changed this to #00000000 and the full brightness of White is showing.

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