魅族魅蓝3(m3) Android5.1使用tint属性运行报错

创建时间:2018/6/12 2:06:38
关键字: android:backgroundTint、android:tint解析错误

  android:backgroundTint="@color/colorPrimary"
        android:tint="@android:color/white"
魅族魅蓝3(m3) Android5.1 使用了以上两个属性,运行报错。去掉后ok了。
 <android.support.design.widget.FloatingActionButton
        android:id="@+id/fab"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_gravity="bottom|center"
        android:layout_marginBottom="@dimen/offset_lg"
        android:backgroundTint="@color/colorPrimary"
        android:tint="@android:color/white"
        app:srcCompat="@drawable/ic_share" />

E/AndroidRuntime: FATAL EXCEPTION: main
                  Process: com.klfront.arch, PID: 11711
                  java.lang.RuntimeException: Unable to start activity ComponentInfo{com.klfront.arch/com.klfront.arch.MainActivity}: android.view.InflateException: Binary XML file line #34: Error inflating class android.support.design.widget.FloatingActionButton
                      at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2714)
                      at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2794)
                      at android.app.ActivityThread.access$900(ActivityThread.java:186)
                      at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1597)
                      at android.os.Handler.dispatchMessage(Handler.java:111)
                      at android.os.Looper.loop(Looper.java:194)
                      at android.app.ActivityThread.main(ActivityThread.java:5905)
                      at java.lang.reflect.Method.invoke(Native Method)
                      at java.lang.reflect.Method.invoke(Method.java:372)
                      at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1127)
                      at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:893)
                   Caused by: android.view.InflateException: Binary XML file line #34: Error inflating class android.support.design.widget.FloatingActionButton
                      at android.view.LayoutInflater.createView(LayoutInflater.java:639)
                      at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:749)
                      at android.view.LayoutInflater.rInflate(LayoutInflater.java:812)
                      at android.view.LayoutInflater.parseInclude(LayoutInflater.java:923)
                      at android.view.LayoutInflater.rInflate(LayoutInflater.java:808)
                      at android.view.LayoutInflater.inflate(LayoutInflater.java:510)
                      at android.view.LayoutInflater.inflate(LayoutInflater.java:420)
                      at android.view.LayoutInflater.inflate(LayoutInflater.java:371)
                      at android.support.v7.app.AppCompatDelegateImplV9.setContentView(AppCompatDelegateImplV9.java:287)
                      at android.support.v7.app.AppCompatActivity.setContentView(AppCompatActivity.java:139)
                      at com.klfront.arch.MainActivity.setContentView(MainActivity.java:54)