基于Maven远程仓库的第一个控件(控件阴影效果)

请注明出处http://blog.csdn.net/qq_23179075/article/details/71244693

描述: 一个控件阴影效果,支持阴影大小和颜色设置,可以设置控件上下的阴影;

使用方式:在build.gradle中加入以下代码

compile 'com.zhengliang:shadow-view:1.0.1'

顶部阴影效果

Paste_Image.png

底部阴影效果

Paste_Image.png

使用方式xml:

<RelativeLayout 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">
        <TextView
            android:id="@+id/tv_test"
            android:layout_width="match_parent"
            android:layout_height="100dp"
            android:background="#FF4567"
            android:gravity="center"
            android:text="Hello World!"
            android:layout_centerInParent="true"
            />
        <com.example.shadowviewlibrary.CustomShadowView
            android:id="@+id/shadow_view"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            app:shadow_color="@color/colorPrimary"
            app:shadow_fuzzy_radius="25"
            app:shadow_height="10dp"
            app:shadow_position="down"
            app:view_id="@id/tv_test" />
</RelativeLayout>

如果要给某个控件加这个阴影效果,必须将要加的控件和该控件放在在RelativeLayout

xml自定义属性java代码功能
shadow_colorsetShadow_color设置阴影颜色
shadow_fuzzy_radiussetShadow_fuzzy_radius设置阴影模糊半径
shadow_heightsetShadow_height设置阴影高度
shadow_positionsetShadow_position设置阴影位置(up上、down下)
view_id绑定需要设置阴影的控件
源码地址:https://github.com/azhengyongqin/shadow-view
  • 1
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值