Ich machte eine activity
, die meine benutzerdefinierte dialog
als Thema verwendet. Ich habe meine drawable
mit abgerundeten Ecken auf die activity's
äußerste PercentRelativeLayout
angewendet, aber die Ecken sind clipping
. Hier ist meine Gewohnheit dialog
in styles.xml
Android Studio Ausschnitt Ecken im Dialogfeld
<style name="myCustomDialog" parent="Theme.AppCompat.Dialog">
<item name="windowActionBar">false</item>
<item name="windowNoTitle">true</item>
</style>
Hier ist meine 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>
Hier ist meine activity
in meinem manifest
<activity android:name=".activities.NotSavedActivity"
android:theme="@style/myCustomDialog">
</activity>
Wenn ich meine Tätigkeit beginnen, die Ecken sind Clipping als in den folgenden Bildern gezeigt
Hierist mein 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>