如何将浮动操作按钮(FAB)转换为菜单,这是我的XML布局。
我想把按钮转换为相关操作菜单
将其转换为一个带有相关操作的菜单,如Material Design所示:
https://storage.googleapis.com/spec-host-backup/mio-design%2Fassets%2F1pdXG8K2i6IR9i5V5raflvDwuADXdUACM%2Ffab-transitions-menu-1.mp4
<android.support.constraint.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<com.applandeo.materialcalendarview.CalendarView
android:id="@+id/calendarView"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_marginStart="8dp"
android:layout_marginTop="8dp"
android:layout_marginEnd="8dp"
android:layout_marginBottom="8dp"
android:layout_weight="1"
app:datePicker="true"
app:eventsEnabled="true"
app:layout_constraintBottom_toTopOf="@+id/floatingActionButton3"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">
</com.applandeo.materialcalendarview.CalendarView>
<android.support.design.widget.FloatingActionButton
android:id="@+id/floatingActionButton3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="16dp"
android:clickable="true"
android:focusable="true"
android:scaleType="center"
android:tint="@color/blanco"
app:backgroundTint="@color/colorAndroid"
app:fabSize="normal"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:srcCompat="@android:drawable/ic_input_add" />
</android.support.constraint.ConstraintLayout>
</FrameLayout>
我想把按钮转换为相关操作菜单
将其转换为一个带有相关操作的菜单,如Material Design所示:
https://storage.googleapis.com/spec-host-backup/mio-design%2Fassets%2F1pdXG8K2i6IR9i5V5raflvDwuADXdUACM%2Ffab-transitions-menu-1.mp4