【发布时间】:2016-01-04 16:10:37
【问题描述】:
我正在尝试减少 棒棒糖前 设备上的FAB 边距,但无论我做什么 - 没有任何改变。我创建了两个FABs 一个是在right|end|bottom 另一个是前一个。 16dp 的边距在 32dp 的两个 FABs 之间形成距离,这对我来说太大了。如果使用bottop_padding 向下按钮的可点击区域与第二个按钮重叠。也许,有人有同样的问题?请帮我!
here is picture of how it looks like
<android.support.design.widget.CoordinatorLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<android.support.design.widget.FloatingActionButton
android:id="@+id/first"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/directions"
app:backgroundTint="@android:color/holo_blue_light"
app:elevation="6dp"
app:pressedTranslationZ="12dp"
android:layout_above="@+id/uer_position"
android:layout_alignParentRight="true"
android:layout_alignParentEnd="true" />
<android.support.design.widget.FloatingActionButton
android:id="@+id/second"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/my_location"
app:backgroundTint="@android:color/white"
app:elevation="6dp"
app:pressedTranslationZ="12dp"
android:layout_alignParentBottom="true"
android:layout_alignParentRight="true"
android:layout_alignParentEnd="true" />
</RelativeLayout>
【问题讨论】:
-
你能发布你的xml文件吗?
-
@MarianoZorrilla,完成
-
那个16dp的边距是哪个?它们在哪里定义?
-
@MarianoZorrilla,我认为这对您没有帮助,因为边距不会以任何方式改变,即使是使用 viewTreeObservers 以编程方式。
-
@TimCastelijns 无处可去。我猜是系统。 imgur.com/BTb9EDq 这是它的样子
标签: android floating-action-button android-support-design