Android 浮动操作按钮未出现在设备上<;5安卓版本
由于某些原因,浮动操作按钮不会出现在<5安卓版本的设备上。当我使用支持库时,CoordinatorLayout和FAB应该可以在版本低于5的版本上正常工作。可能是什么Android 浮动操作按钮未出现在设备上<;5安卓版本,android,floating-action-button,coordinator-layout,Android,Floating Action Button,Coordinator Layout,由于某些原因,浮动操作按钮不会出现在
<?xml version="1.0" encoding="utf-8"?>
<android.support.design.widget.CoordinatorLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent">
<android.support.design.widget.AppBarLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar">
<android.support.v7.widget.Toolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?attr/colorPrimary"
android:minHeight="?attr/actionBarSize"
app:layout_scrollFlags="scroll|enterAlways"
app:titleTextColor="@android:color/white"
/>
</android.support.design.widget.AppBarLayout>
<android.support.design.widget.FloatingActionButton
android:id="@+id/floatingActionButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="bottom|end"
android:layout_margin="@dimen/default_margin"
android:src="@drawable/ic_add"
app:backgroundTint="@color/red"
app:elevation="@dimen/default_margin"
/>
<FrameLayout
android:id="@+id/frame"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:layout_behavior="@string/appbar_scrolling_view_behavior"
/>
</android.support.design.widget.CoordinatorLayout>
我认为FAB应该是包装在协调器布局中的最后一个子视图。我认为FAB应该是包装在协调器布局中的最后一个子视图。请参考此处的示例项目。我认为FAB应该是包装在协调器布局中的最后一个子视图。@ishwor它会有所帮助。你可以发表这个评论作为答案,我会选择它。感谢您的帮助。很高兴它解决了您的问题。请参阅此处的示例项目。我认为FAB应该是包装在协调器布局中的最后一个子视图。@ishwor它会有所帮助。你可以发表这个评论作为答案,我会选择它。谢谢你的帮助。很高兴它解决了你的问题