【发布时间】:2020-12-18 15:25:32
【问题描述】:
以下代码中的 FAB 显示在 api 29 手机中,但未显示在 api 24 手机中。如何解决这个问题? 我使用材料设计库和导航组件。
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
xmlns:app="http://schemas.android.com/apk/res-auto"
tools:context=".ui.HomeFragment">
<com.google.android.material.floatingactionbutton.FloatingActionButton
android:id="@+id/btn_add"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_alignParentBottom="true"
android:clickable="true"
app:tint="@android:color/white"
android:src="@drawable/ic_add"
/>
</RelativeLayout>
【问题讨论】:
标签: android material-design floating-action-button