有没有办法克服FAB按钮中的剪辑?

时间:2016-04-16 14:39:49

标签: android material-design floating-action-button

我正致力于为FAB的可绘制动画制作动画。动画使得drawable的一部分大两倍。但是,一旦开始增长,它将被剪切在FAB的布局下:

FAB in question

有没有办法可以避免这种剪辑?

它被放置在CoordinatorLayout中,因此不可能将ImageView放在FAB之上,并使其看起来只有一个项目。

此外,无法编辑clipChildren属性,因为该属性与ViewGroup相关,而这只是一个View。

这是布局:

<android.support.design.widget.CoordinatorLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:fitsSystemWindows="true"
    android:clipChildren="false"
    tools:context="com.example.aleksandar.rasporedcasova.MainActivity">

    [other contents of CoordinatorLayout]

    <android.support.design.widget.FloatingActionButton
        android:id="@+id/fab"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_gravity="bottom|end"
        android:layout_margin="@dimen/fab_margin"
        android:src="@drawable/bluetooth_drawable_animated" />

</android.support.design.widget.CoordinatorLayout>

0 个答案:

没有答案