![](/img/trans.png)
[英]How to draw a rectangle with round end circle corners using XML like Sticker View Corner
[英]How to define a rectangle with a circle at the end using Android XML definitions
是否可以定義如下圖所示的形狀:
我嘗試了一個圖層列表,但我找不到接近我要找的解決方案。
我想將生成的形狀用作具有透明度的RelativeLayout的背景圖像。
任何提示都表示贊賞! 謝謝。
這是你要求的形狀:
<?xml version="1.0" encoding="UTF-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android" >
<item>
<shape android:shape="rectangle">
<size
android:width="250dp"
android:height="100dp" />
<solid android:color="#ffffff" />
</shape>
</item>
<item
android:top="0dp">
<shape android:shape="line">
<stroke
android:width="25dp"
android:color="#000000" />
</shape>
</item>
<item
android:right="0dp"
android:left="150dp">
<shape android:shape="oval">
<solid android:color="#000000" />
</shape>
</item>
</layer-list>
截圖:
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.