Java android FloatingActionButton API 19没有看到
在三星galaxy s4 mini上,我没有看到浮动操作按钮,但在三星galaxy s6 API 23上,我看到了此按钮。以下是我添加此按钮的方式:Java android FloatingActionButton API 19没有看到,java,android,api,Java,Android,Api,在三星galaxy s4 mini上,我没有看到浮动操作按钮,但在三星galaxy s6 API 23上,我看到了此按钮。以下是我添加此按钮的方式: <android.support.design.widget.FloatingActionButton android:id="@+id/qick_menu_bt" android:layout_width="wrap_content" android:layout_height="55dp
<android.support.design.widget.FloatingActionButton
android:id="@+id/qick_menu_bt"
android:layout_width="wrap_content"
android:layout_height="55dp"
android:layout_margin="20dp"
android:src="@drawable/quick_menu"
app:layout_anchor="@id/mapview"
app:layout_anchorGravity="bottom|right|end" />
<android.support.design.widget.FloatingActionButton
android:id="@+id/list"
android:layout_width="wrap_content"
android:layout_height="55dp"
android:layout_margin="20dp"
android:src="@drawable/lista"
app:layout_anchor="@id/mapview"
app:layout_anchorGravity="bottom|left|end" />
正如android文档中提到的,FAB是在API 21及以上版本中添加的,因此您必须为API 19定制它,但这不是推荐的方式
用这个可能会有用
compile 'com.android.support:design:22.2.0'
您确定这些按钮的位置适合您正在测试的设备吗?它是在api 22.2.0中添加的,因此在api 19中不可见。如果您想使用,您可以使用第三方libraries@KamranAhmed请看,这是我在Android Studio中拥有的:@VivekMishra那么我应该做什么?@vivek mishra设计支持库提供了到API 9的向后兼容性。如问题中所述,KrzysztofPokrywka正在从支持库android.support.design.widget.FloatingActionButton中使用它。它是在设计库v22.2.0中添加的,正如KrzysztofPokrywka提到的,他使用的是v23.0.1。如何为API 19定制?设计支持库提供了向后兼容性。正如问题中提到的,@KrzysztofPokrywka正在从支持库android.support.design.widget.FloatingActionButton使用它。那么我该怎么做呢?
compile 'com.android.support:design:22.2.0'