智慧印刷工坊

智慧印刷工坊

Android为视图打标签

admin 1 192

AndroidUILibs之LabelView

1.说明

LabelView,顾名思义,标签视图,利用该库,我们可以给视图添加上一个标签。

我们经常在网页上看到“ForkmeonGithub”的Banner,而利用该库我们可以在Android上显示这样的Banner。


2.配置

首先在工程的上面添加JitPack仓库

allprojects{

repositories{

maven{url""}

}

}

其次,在模块的上面添加依赖

depencies{

compile':labelview:'}

3.基本使用

该库自带可以在Button,ImageView,TextView上打标签的类:LabelButtonView,LabelImageView,LabelTextView。

LabelButtonView的使用:

android:id="@+id/labelButton"

android:layout_width="200dp"

android:layout_height="48dp"

android:background="ffffff"

app:label_backgroundColor="C2185B"

app:label_orientation="LEFT_TOP"

app:label_text="lavor"/

LabelTextView的使用:

android:id="@+id/labelText"

android:layout_width="200dp"

android:layout_height="48dp"

android:layout_marginTop="8dp"

android:background="ffffff"

app:label_backgroundColor="03A9F4"

app:label_distance="15dp"

app:label_orientation="RIGHT_TOP"

app:label_text="微信"

app:label_textSize="10sp"/

程序源代码下载,我的github仓库: