Android   发布时间:2022-04-01  发布网站:大佬教程  code.js-code.com
大佬教程收集整理的这篇文章主要介绍了怎么能在矩形形状内画一条线android [复制]大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。

参见英文答案 > Android: How can i use the layer-list and shape elements to draw a horizontal rule when set as background?                                    2个
我有这样的自定义矩形

<?xml version="1.0" encoding="utf-8"?>
    <shape xmlns:android="http://scheR_998_11845@as.android.com/apk/res/android" android:shape="rectangle" android:padding="10dp">
    <solid android:color="#FFFFFF" />
    <stroke android:width="1dip" android:color="#ff6600" />
    <corners
        android:bottomRighTradius="5dp"
        android:bottomLefTradius="5dp"
        android:topLefTradius="5dp"
        android:topRighTradius="5dp"/>
</shape>

我想在这个矩形内画一条线

<shape xmlns:android="http://scheR_998_11845@as.android.com/apk/res/android" android:shape="line" >
    <solid android:color="@color/cafe" />    
    <stroke android:width="5dip" 
    android:color="#FF0000" android:dashWidth="5dip"/>
</shape>

我怎么能这样做,帮助

解决方法:

关键字是layer-list.这是一个非常好的例子,完全基于xml:Android: How can i use the layer-list and shape elements to draw a horizontal rule when set as background?

大佬总结

以上是大佬教程为你收集整理的怎么能在矩形形状内画一条线android [复制]全部内容,希望文章能够帮你解决怎么能在矩形形状内画一条线android [复制]所遇到的程序开发问题。

如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。

本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。
标签: