I'm creating the login page in Android Studio and I got problem with building the project.
In one tutorial, it was shown that including #1100000 hexacode will help to make Text transparent, it does, however when I build program it gives error of
error: '#1100000' is incompatible with attribute android:background (attr) reference|color.
I have checked one question which says to add @android:color/transparent , however that doesn't help. Any recommendations?
<EditText
android:id="@+id/editText"
android:layout_width="200dp"
android:layout_height="50dp"
android:layout_below="@+id/textView2"
android:layout_centerHorizontal="true"
android:drawableLeft="@drawable/ic_action_pass"
android:drawableStart="@drawable/ic_action_pass"
android:ems="10"
android:background="#1100000"
android:hint="@string/password"
android:inputType="textPassword"
android:textSize="18sp" />
Try this
android:background="@null"
android:background="@android:color/transparent"
You forgot a 0. #1100000 should be #11000000.
The value always begins with a pound (#) character and then followed by the Alpha-Red-Green-Blue information in one of the following formats:
- #RGB
- #ARGB
- #RRGGBB
- #AARRGGBB
https://developer.android.com/guide/topics/resources/more-resources#Color
Alpha channel represents the transparency value. Some examples:
100% - FF
95% - F2
90% - E6
85% - D9
80% - CC
75% - BF
70% - B3
65% - A6
60% - 99
55% - 8C
50% - 80
45% - 73
40% - 66
35% - 59
30% - 4D
25% - 40
20% - 33
15% - 26
10% - 1A
5% - 0D
0% - 00