所以我的布局上有两个浮动动作按钮:
<?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.FloatingActionButton
android:id="@+id/add_assignment_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="bottom|end"
android:src="@drawable/ic_add_white_24dp" />
<android.support.design.widget.FloatingActionButton
android:id="@+id/start_session_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="top|end"
android:src="@drawable/ic_play_arrow_white_24dp"
app:layout_anchor="@id/add_assignment_button"
app:layout_anchorGravity="top"></android.support.design.widget.FloatingActionButton>
<ListView
android:id="@+id/android:list"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1">
</ListView>
</android.support.design.widget.CoordinatorLayout>
我厌倦了为这两个按钮设置app:useCompatPadding="true"
,但后来我得到了这个,这不是更好:
一些帮助将不胜感激,谢谢!