Android三角标签View:TriangleLabelView
2018-01-04 00:00
645 查看
Android三角标签View:TriangleLabelView
在一些商城、产品推销类APP中,如淘宝、京东、电影门票销售、商品降价促销这类的APP,常常会在其APP中看到,某些商品的左上角或者右上角有一些三角的标签,这些标签View的实现很多种,我在以前介绍过一种第三方开源的实现,见附录文章1。
本文再介绍一种类似实现:TriangleLabelView。
TriangleLabelView是第三方开源项目,其在github上的项目主页是:https://github.com/shts/TriangleLabelView
实现结果如图所示:
TriangleLabelView可以通过配置xml文件即可实现,我写一个例子说明:
代码运行结果如图:
附录文章:
1,《Android View标签LabelView(电商、商城类APP常用)》链接地址:http://blog.csdn.net/zhangphil/article/details/49836773
Android三角标签View:TriangleLabelView
在一些商城、产品推销类APP中,如淘宝、京东、电影门票销售、商品降价促销这类的APP,常常会在其APP中看到,某些商品的左上角或者右上角有一些三角的标签,这些标签View的实现很多种,我在以前介绍过一种第三方开源的实现,见附录文章1。
本文再介绍一种类似实现:TriangleLabelView。
TriangleLabelView是第三方开源项目,其在github上的项目主页是:https://github.com/shts/TriangleLabelView
实现结果如图所示:
TriangleLabelView可以通过配置xml文件即可实现,我写一个例子说明:
<?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" tools:context="zhangphil.demo.MainActivity"> <RelativeLayout android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_centerInParent="true"> <TextView android:layout_width="200dip" android:layout_height="100dip" android:layout_centerInParent="true" android:background="@android:color/holo_blue_light" android:gravity="center" android:text="Zhang Phil" /> <jp.shts.android.library.TriangleLabelView xmlns:app="http://schemas.android.com/apk/res-auto" android:layout_width="match_parent" android:layout_height="match_parent" android:layout_alignParentLeft="true" android:layout_alignParentTop="true" app:backgroundColor="@android:color/holo_orange_light" app:corner="leftTop" app:labelBottomPadding="5dp" app:labelCenterPadding="0dp" app:labelTopPadding="10dp" app:primaryText="CSDN" app:primaryTextColor="@android:color/holo_red_light" app:primaryTextSize="16sp" app:secondaryText="blog" app:secondaryTextColor="@android:color/holo_purple" app:secondaryTextSize="11sp" /> </RelativeLayout> </RelativeLayout>
代码运行结果如图:
附录文章:
1,《Android View标签LabelView(电商、商城类APP常用)》链接地址:http://blog.csdn.net/zhangphil/article/details/49836773
相关文章推荐
- Android三角标签View:TriangleLabelView
- Android三角标签View:TriangleLabelView
- Android三角标签View:TriangleLabelView
- Android 三角标签控件、角标(AvatarLabelView)
- Android 三角标签(自定义Textview控件)
- Android自定义标签LabelView详细思路及过程
- android LabelView实现标签云效果
- Android View标签LabelView
- Android View标签LabelView(电商、商城类APP常用)
- android 自定义LabelView实现各类小标签,重要功能已标注
- 添加个性标签—三方开源TriangleLabelView
- android 自定义LabelView实现各类小标签,重要功能已标注
- Android View标签LabelView(电商、商城类APP常用)
- webview中的img标签加载Android本地的图片
- Android中标签TextView的使用
- android--------WebView实现 Html5 视频标签加载
- Android 开源框架ViewPageIndicator 和 ViewPager 仿网易新闻客户端Tab标签
- Android_自定义标签ViewLayout
- Android图片添加标签:Android-PictureTagView
- android中viewStub,merge,include,requestFocus标签介绍