我今天在android系统上使用fab 按钮,遇到了以往没有遇到的问题,因为以前不做什么修改直接就用了,这次修改了一下背景颜色,出问题了
<android.support.design.widget.FloatingActionButton android:id="@+id/fab_up" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginBottom="140dp" android:layout_marginEnd="16dp" android:layout_marginRight="16dp" android:clickable="true" app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintRight_toRightOf="parent" app:pressedTranslationZ="@dimen/ten" app:srcCompat="@drawable/ic_action_up" android:backgroundTint="@color/colorPrimaryDark" -------就是这行出错了,需要把android改成app即可 android:visibility="invisible"/>
ERROR:android.view.InflateException: Binary XML file line #0: Error inflating class android.support.design.widget.FloatingActionButton
参考:https://stackoverflow.com/questions/42221530/error-inflating-class-android-support-design-widget-floatingactionbutton