您的位置:首页 > 移动开发 > Android开发

Android-->打造流行的无数据空布局页面

2017-01-01 17:19 381 查看
看图:



实现方式,就是在一个自定义View里面, 绘制一个大的圆角矩形, 和三个小的圆角矩形.

支持的属性,

<?xml version="1.0" encoding="utf-8"?>
<resources>
<declare-styleable name="EmptyView">
<!--颜色-->
<attr name="ev_default_color" format="color"/>
<!--有多少个组, 在高度warp_content属性中生效, match_parent属性自动通过高度计算数量-->
<attr name="ev_group_count" format="integer"/>
<!--每一组的高度, 一组由一个大的三个小的矩形组成-->
<attr name="ev_group_height" format="dimension"/>
<!--大矩形和小矩形之间的空隙-->
<attr name="ev_h_space" format="dimension"/>
<!--组与组之间和小矩形之间的竖直空隙-->
<attr name="ev_v_space" format="dimension"/>
<!--圆角的大小-->
<attr name="ev_round_radius" format="dimension"/>
</declare-styleable>
</resources>


源码地址:https://github.com/angcyo/EmptyView
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  空布局