有没有办法在Android XML中的矩形中绘制一个单边三角形。就像下面的这张图片...
您可以像这样使用vector drawable
<?xml version="1.0" encoding="utf-8"?>
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="200dp"
android:height="200dp"
android:viewportWidth="200"
android:viewportHeight="200">
<path
android:fillColor="#ffffff"
android:pathData="M7.5 131.61L138.5 128.88L187.87 97.48L138.5 67.2L7.5 67.2L7.5 131.61Z" />
<path
android:fillColor="#000000"
android:fillAlpha="0"
android:strokeColor="#152dbe"
android:strokeWidth="3"
android:pathData="M7.5 131.61L138.5 128.88L187.87 97.48L138.5 67.2L7.5 67.2L7.5 131.61Z" />
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句