分享一个控件添加阴影的库

2017-04-24  本文已影响228人  caym

github地址:https://github.com/dmytrodanylyk/shadow-layout

该库要求最低sdk版本为:14

使用gradle引用该库到你的项目:

compile 'com.github.dmytrodanylyk.shadow-layout:library:1.0.3'

xml中使用

<com.dd.ShadowLayout
        android:layout_marginTop="16dp"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        app:sl_shadowRadius="4dp"
        app:sl_shadowColor="#AA000000"
        app:sl_dx="0dp"
        app:sl_dy="0dp"
        app:sl_cornerRadius="56dp">

    <ImageButton
            android:layout_width="56dp"
            android:layout_height="56dp"
            android:src="@drawable/ic_add_white"
            android:background="@drawable/fab_selector"
            tools:ignore="ContentDescription"/>

</com.dd.ShadowLayout>
上一篇 下一篇

猜你喜欢

热点阅读