简体   繁体   中英

Error Inflating for Background Drawables for marshmallow

This Code is working fine with Lollipop bellow. But for Marshmallow , I am getting Inflating Error because of the

android:background="@drawable/border_box_gray"

-

  <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:orientation="horizontal"
        android:background="@drawable/border_box_gray"

        android:padding="10dp"
        android:divider="@drawable/divider"
        android:showDividers="middle"
        android:layout_marginTop="20dp"
        android:id="@+id/race_list_linearlayout">

This is the border_box_ray xml file

<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"android:shape="rectangle" >
<solid android:color="#202020" />
<stroke android:width="1dip" android:color="#9b9b9b"/>
</shape>

I don't have app:srcCompat for Gradle . But I am not sure how to work around this issue.

看起来您忘了在android:shape之前加上空格

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