まず、描画可能なフォルダに3 xml
layout
を作成します。
- まず:frame.xml
- 第二:frame_build.xml
- サード:red.xml
(chan GEはこの名前、あなたが望むように)、
frame.xml:
<?xml version="1.0" encoding="UTF-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item android:bottom="20dp" android:drawable="@drawable/red" android:top="-25dp" />
<item android:bottom="15dp" android:drawable="@drawable/frame_build" android:top="5dp" android:left="-5dp" android:right="-5dp" />
</layer-list>
frame_build.xml:
<?xml version="1.0" encoding="UTF-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle">
<padding android:left="10dp" android:top="10dp" android:right="10dp" android:bottom="10dp" />
<corners android:radius="40dp" />
</shape>
red.xml
<?xml version="1.0" encoding="UTF-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle">
<stroke android:width="40dp" android:height="40dp" android:color="#B22222" />
<padding android:left="8dp" android:top="-1dp" android:right="8dp" android:bottom="9dp" />
<corners android:radius="-10dp" />
</shape>
は、最後に次のようにXMLをフレームにあなたのビューやレイアウトを参照してください。
android:background="@drawable/frame"
これは画像以下のようにテストされ、出力:
・ホープこのヘルプ。
は、私はちょうど必要なもののように思える、私は試してみましょう答えとして – user606669
@ user606669を記入しておきます。 –
私は試しましたが、その黒い背景は透明ではありません。間違ったことをしています。私はframelayoutでそれを使用しており、その下にフレームを表示する必要があります。 – user606669