星空网 > 软件开发 > 操作系统

圆角边框和渐变

圆角边框和渐变images/loading.gif' data-original="http://images0.cnblogs.com/blog2015/705618/201507/232228409438892.png" />

 

Demo2\aa\src\main\res\drawable\bg_border.

1 <??>2 <shape ="http://schemas.android.com/apk/res/android">3   <!--设置背景色为透明色-->4   <solid android:color="#0000"/>5   <!--设置红色边框-->6   <stroke android:width="4dp" android:color="#f00"/>7 </shape>

 

Demo2\aa\src\main\res\drawable\bg_border2.

 1 <??> 2 <shape ="http://schemas.android.com/apk/res/android" 3   android:shape="rectangle"> 4   <!--指定圆角矩形的4个圆角的半径--> 5   <corners 6     android:bottomLeftRadius="5dp" 7     android:bottomRightRadius="20dp" 8     android:topLeftRadius="20dp" 9     android:topRightRadius="5dp" />10   <!--指定边框线条的宽度和颜色-->11   <stroke12     android:width="4dp"13     android:color="#f0f" />14   <!--指定使用渐变背景色,使用sweep类型的渐变(红绿蓝)-->15   <gradient16     android:centerColor="#0f0"17     android:endColor="#00f"18     android:startColor="#f00"19     android:type="sweep" />20 </shape>

 

Demo2\aa\src\main\res\layout\activity_main.

 1 <LinearLayout ="http://schemas.android.com/apk/res/android" 2   ="http://schemas.android.com/tools" 3   android:layout_width="match_parent" 4   android:layout_height="match_parent" 5   android:orientation="vertical" 6   tools:context=".MainActivity"> 7  8   <!--通过background指定背景--> 9   <TextView10     android:layout_width="match_parent"11     android:layout_height="wrap_content"12     android:text="带边框的文本"13     android:textSize="24sp"14     android:background="@drawable/bg_border"/>15   <TextView16     android:layout_width="match_parent"17     android:layout_height="wrap_content"18     android:text="圆角边框,渐变背景的文本"19     android:textSize="24sp"20     android:background="@drawable/bg_border2"/>21 22 </LinearLayout>

 




原标题:圆角边框和渐变

关键词:

*特别声明:以上内容来自于网络收集,著作权属原作者所有,如有侵权,请联系我们: admin#shaoqun.com (#换成@)。

亚马逊英国 是否不收vat税:https://www.kjdsnews.com/a/1322008.html
亚马逊法国vat:名字核对是否需要白纸签名:https://www.kjdsnews.com/a/1322009.html
深入了解:vat number是什么:https://www.kjdsnews.com/a/1322010.html
如何合理地在亚马逊欧洲站上避免vat税务:https://www.kjdsnews.com/a/1322011.html
派安盈:交vat税金答案在这里!:https://www.kjdsnews.com/a/1322012.html
欧洲各国是否需要单独征收vat:https://www.kjdsnews.com/a/1322013.html
无锡旅游景点竹海 - 无锡的竹海:https://www.vstour.cn/a/363178.html
5月贾汪好玩的地方 贾汪哪有好玩的地方:https://www.vstour.cn/a/363179.html
相关文章
我的浏览记录
最新相关资讯
海外公司注册 | 跨境电商服务平台 | 深圳旅行社 | 东南亚物流