dialog
をテーマにしてactivity
を作成しました。私はdrawable
を丸みのある角でactivity's
の最も外側のPercentRelativeLayout
に貼り付けましたが、角はclipping
です。ここではここstyles.xml
ダイアログボックスのAndroidスタジオクリッピングコーナー
<style name="myCustomDialog" parent="Theme.AppCompat.Dialog">
<item name="windowActionBar">false</item>
<item name="windowNoTitle">true</item>
</style>
に私のカスタムdialog
であることはここに私のdrawable
<?xml version="1.0" encoding="utf-8"?>
<shape
xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<corners android:radius="5dp" />
<stroke
android:width="1dip"
android:color="#000" />
</shape>
である私の私の
<activity android:name=".activities.NotSavedActivity"
android:theme="@style/myCustomDialog">
</activity>
私は私の活動を開始manifest
、コーナーのようにクリッピングされている中activity
下の画像に示す
あなたが見る私のactivity's xml
<?xml version="1.0" encoding="utf-8"?>
<android.support.percent.PercentRelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="15dp"
android:background="@drawable/not_saved_module">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Du har inte sparat, stäng ändå?"
android:id="@+id/notSavedTextView"/>
<RelativeLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_below="@+id/notSavedTextView">
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/yes"
android:text="Ja"/>
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/no"
android:text="Nej"
android:layout_toRightOf="@id/yes"
android:layout_toEndOf="@+id/yes"/>
</RelativeLayout>
</android.support.percent.PercentRelativeLayout>