このダイアログ レイアウトをコーディングしたい: http://fooh.pl/pokaz/348687655.png
緑のコンテナはオレンジのコンテナに入っています。ダイアログの上部に TextView があります。右上隅にはボタンがあります。
レイアウトの種類は知っていますが、失敗しました。
誰でも私を助けることができますか?お願いします。
このダイアログ レイアウトをコーディングしたい: http://fooh.pl/pokaz/348687655.png
緑のコンテナはオレンジのコンテナに入っています。ダイアログの上部に TextView があります。右上隅にはボタンがあります。
レイアウトの種類は知っていますが、失敗しました。
誰でも私を助けることができますか?お願いします。
どうぞ:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/rounded_orange">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_margin="8dp"
android:text="Text"/>
<RelativeLayout
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginTop="32dp"
android:background="@drawable/rounded_green">
</RelativeLayout>
</RelativeLayout>
ドローアブル (ここでは緑色のみ表示) は次のように配置されます。
<?xml version="1.0" encoding="UTF-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle">
<solid android:color="#0F0"/>
<corners android:radius="16dp"/>
</shape>
カスタムの layout.xml ファイルをダイアログに適用する方法についてサポートが必要な場合は、Dialog の公式ドキュメントの「Creating a Custom Dialog」を参照してください。