LcLableView 轻松添加 热门 最新 等标签

LablieView

效果图

效果图1
效果图2
这里写图片描述

使用说明

导入 lclablelibrary 到项目中

在 build.gradle 的 dependencies 添加:

    dependencies {
    compile fileTree(include: ['*.jar'], dir: 'libs')
    ....
    compile project(':lclablelibrary')
    }
属性
Attribute 属性Description 描述
lv_text设置文字内容
lv_text_color设置文字颜色,默认#ffffff
lv_text_size设置文字大小,默认11sp
lv_text_bold设置文字是否支持加粗,默认true
lv_text_all_caps设置文字是否支持全部大写,默认true
lv_background_color设置背景颜色,默认”#FF4081”
lv_min_size设置LabelView所在矩形最小宽高,默认35dp或50dp
lv_padding设置文字上下padding,默认3.5dp
lv_gravity设置LabelView方向
lv_fill_triangle设置是否填充三角区域,默认false
lv_fill_size设置是否浮嵌显示大小

实际使用代码

使用空边标签时
 <FrameLayout
    android:layout_width="match_parent"
    android:layout_height="match_parent">
    <View
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:background="@drawable/bag"
        android:orientation="vertical"
        android:gravity="center">
    </View>
    <com.xiaochao.lclablelibrary.LabelView
        android:layout_width="60dp"
        android:layout_height="60dp"
        android:layout_gravity="bottom"
        lv:lv_background_color="#FF6666"
        lv:lv_gravity="BOTTOM_LEFT"
        lv:lv_text="十年经验"
        lv:lv_text_size="8dp"
        />
 </FrameLayout>
使用浮嵌标签时

要注意容器的android:layout_margin=”3dp”必须和lv:lv_fill_size=”3”值一样

<FrameLayout
    android:layout_width="match_parent"
    android:layout_height="match_parent">
    <View
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:layout_margin="3dp"
        android:background="@drawable/bag"
        android:orientation="vertical"
        android:gravity="center">
    </View>
    <com.xiaochao.lclablelibrary.LabelView
        android:layout_width="60dp"
        android:layout_height="60dp"
        lv:lv_background_color="#FF6666"
        lv:lv_gravity="TOP_LEFT"
        lv:lv_text="十年经验"
        lv:lv_text_size="8dp"
        lv:lv_fill_size="3"
        />
</FrameLayout>
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值