下面是蓝色矩形边框的示例。我想要做的是创建我自己的形状值<shape android:shape="rectangle" >
,其中形状不是矩形,而只是一个带有类似于这张照片的角的框架https://banner2.kisspng.com/20180205/ecq/kisspng-video-camera-电影帧视频摄像机取景器帧数字摄像机 5a7860497defb6.1781782515178384095158.jpg。
到目前为止,我尝试使用 dashWidth 和 dashGap 来尝试使其适合角落,但我遇到了问题。我在网上(youtube/google)看过,我看到了线条、椭圆形和环形的形状。没有角落所以我想创建自己的
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android" >
<item>
<shape android:shape="rectangle" >
<solid android:color="@android:color/transparent" />
<stroke
android:width="4dp"
android:color="#263ADD"
android:dashWidth="80dp"
android:dashGap="80dp"/>
</shape>
</item>
</layer-list>
Android 现在将 SVG 导入到 XML。使用 Android Studio 将您的图像转换为 SVG 并进行简单导入。
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句