Home » Android » android – unknown exclamatory symbol in the xml file

android – unknown exclamatory symbol in the xml file

Posted by: admin June 15, 2020 Leave a comment

Questions:

Getting unknown exclamatory error in xml file Image view, when i try to set a ripple effect in “android:background” attribute.

I commented the line where i get this error.

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/tabContainer"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:padding="15dp"
>

<ImageView
    android:id="@+id/tabImage"
    android:layout_width="match_parent"
    android:background="@drawable/tab_bg" <!-- Line where I get error-->
    android:layout_height="wrap_content"
    android:layout_gravity="center" />

<TextView
    android:id="@+id/tabText"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:gravity="bottom|center" />
</LinearLayout>

If I click that exclamatory it directs to the following file.

v22/tab_bg.xml

<?xml version="1.0" encoding="utf-8"?>
<ripple xmlns:android="http://schemas.android.com/apk/res/android"
android:color="?android:attr/colorControlHighlight">
<item android:id="@+id/mask"
    android:drawable="@android:color/white"/>

</ripple>

The application is running perfectly, but i am not able to get this ripple effect.

Note: I am using Android Studio 1.4

How to&Answers:

Don’t worry, it’s for the new Android Studio 1.4, it’s appear because there, normally, appear a little icon showing the image from Drawable but if you are using a drawable xml (not being an image), the IDE cannot show a little preview but, don’t worry for that error because It's not an error =)

If you can’t get the ripple effect maybe it’s for another issue then you need to do another question for that.