手机
当前位置:查字典教程网 >编程开发 >安卓软件开发 >Android TextView(圆弧)边框和背景实例详解
Android TextView(圆弧)边框和背景实例详解
摘要:AndroidTextView圆弧效果图:布局代码:样式代码:弧度和背景主要靠background中的.xml文件实现1、2、感谢阅读,希望...

Android TextView 圆弧

效果图:

Android TextView(圆弧)边框和背景实例详解1

Android TextView(圆弧)边框和背景实例详解2

布局代码:

<TextView android:id="@+id/product_tag" android:layout_width="wrap_content" android:layout_height="wrap_content" android:gravity="center" android:singleLine="true" android:textSize="10sp" android:textColor="@color/label_orange" android:layout_marginLeft="10dp" android:background="@drawable/shape_label_orange" android:text="标签"/>

样式代码:

弧度和背景主要靠background中的.xml文件实现

Android TextView(圆弧)边框和背景实例详解2

1、

<"1.0" encoding="utf-8"?> <shape xmlns:android="http://schemas.android.com/apk/res/android"> <> <solid android:color="@android:color/white"/> <> <stroke android:width="0.5dp" android:color="@color/label_orange"/> <> <corners android:radius="3dp"/> <> <padding android:top="2dp" android:bottom="2dp" android:left="6dp" android:right="6dp"/> </shape>

2、

Android TextView(圆弧)边框和背景实例详解1

<"1.0" encoding="utf-8"?> <shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="oval" android:useLevel="false"> <> <solid android:color="@color/label_round_orange" /> <> <corners android:radius="360dp" /> <> <padding android:bottom="1dp" android:left="1dp" android:right="1dp" android:top="1dp" /> <> <size android:width="15dp" android:height="15dp" /> </shape>

感谢阅读,希望能帮助到大家,谢谢大家对本站的支持!

【Android TextView(圆弧)边框和背景实例详解】相关文章:

Android 原始资源文件的使用详解

android 弹出提示框的使用(图文实例)

Android中Service(后台服务)详解

Android View添加 Listener 实例代码

android viewpaper实例探讨

Android单选对话框和多选对话框

android TextView属性的详细介绍 分享

Android列表实现(2)_游标列表案例讲解

Android控件之TextView的分析探究

android panellistview 圆角实现代码

精品推荐
分类导航