Android三角标签View:TriangleLabelView
2016-06-15 10:52
405 查看
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软键盘的监听和手动弹起
- Android应用程序框架——智能指针(一)
- 实用Android Studio 插件
- Android Fragment getActivity返回null解决
- android官方博客
- 安卓应用所用到的插件及知识点
- git学习之路
- Android 使用动态加载框架DL进行插件化开发
- android opengl学习推荐博文
- Android开发中SharedPreferences工具类
- Android中AlertDialog中创建OnClickListener的错误
- 彻底了解android中的内部存储与外部存储
- Android Studio小技巧 cast快捷键
- 一个Android项目中各目录介绍
- Android 横屏不让输入法全屏显示
- 活动的启动模式
- Android 自动化测试之Monkey参数介绍及其停止办法
- Android基础内容提供者ContentProvider的使用详解(转)
- ubuntu16.04 编译android 源码出现的错误
- Android内存泄露检测工具---LeakCanary的前世今生