【发布时间】:2017-12-09 14:17:57
【问题描述】:
我在我的应用程序中使用https://github.com/mattprecious/swirl/blob/master/README.md。 我不想在lowwer sdk marshmallow 版本上出现SwirlView。因为 SwirlView 在版本 sdk marshmallow 或更高版本上工作。
所以我将“tools:targetApi='M'”添加到 SwirlView xml 节点。看看下面的代码。
<com.mattprecious.swirl.SwirlView
android:id="@+id/fingerprint_SwirlView"
android:layout_width="100dp"
android:layout_height="100dp"
tools:targetApi="M"/>
但是当我在棒棒糖版本上运行应用程序时。发生这样的错误。
android.view.InflateException: Binary XML file line #29: Error inflating class com.mattprecious.swirl.SwirlView
我的代码有什么问题。 对不起我的英语水平不好。
【问题讨论】: