我想建立shape
與bottom line
和text
裏面我很困惑一點點如何實現這個我累 一些代碼,但沒有得到所需的東西。如何在xml android中構建梯形形狀?
到目前爲止,我已經嘗試過這種代碼
shape.xml
<?xml version="1.0" encoding="UTF-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android" >
<!-- Colored rectangle-->
<item>
<shape android:shape="rectangle">
<size
android:width="100dp"
android:height="40dp" />
<solid android:color="#13a89e" />
</shape>
</item>
<!-- This rectangle for the right side -->
<!-- Their color should be the same as layout's background -->
<item
android:right="-100dp"
android:left="100dp"
android:top="-100dp"
android:bottom="-100dp">
<rotate
android:fromDegrees="45">
<shape android:shape="rectangle">
<solid android:color="#ffffff" />
</shape>
</rotate>
</item>
</layer-list>
我還需要這個形狀下面的黃線。
感謝您的幫助。
看起來你幾乎就在那裏。將另一個矩形放在第一個矩形下方(高度較低)。爲左側製作另一個傾斜的矩形。使兩個傾斜的矩形略小一點。並做一些關於顏色... – kalabalik
我試圖把左邊相同的白色形狀,但我不知道如何做到這一點 –