在xml文件中获取未知的感叹错误图像视图,当我尝试在"android:background"属性中设置涟漪效果时.
我评论了我收到此错误的行.
<?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>
Run Code Online (Sandbox Code Playgroud)
如果我点击该感叹号,它会指向以下文件.
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>
Run Code Online (Sandbox Code Playgroud)
应用程序运行正常,但我无法获得这种连锁反应.
注意:我使用的是Android Studio 1.4