Ich versuche, Halbkreis Hintergrund zu erstellen, in development IDE preview
funktioniert es, aber wenn ich im Emulator starten, funktioniert es nicht.Halbkreisform funktioniert nicht
Hier ist meine Form Code:
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item android:height="50dp">
<shape>
<solid android:color="@color/colorAccentDark" />
</shape>
</item>
<item android:top="-500dp" android:bottom="0dp" android:left="-100dp" android:right="-100dp">
<shape>
<corners android:radius="500dp" />
<solid android:color="@color/colorAccentDark" />
</shape>
</item>
</layer-list>
Und hier ist mein Layout-Code:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@drawable/background_profile"
android:layout_weight="1">
<de.hdodenhof.circleimageview.CircleImageView
android:id="@+id/profile_avatar"
android:layout_width="100dp"
android:layout_height="100dp"
android:src="@drawable/ic_default_avatar"
android:layout_centerHorizontal="true"
android:layout_marginTop="50dp"/>
<TextView
android:id="@+id/profile_name"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_below="@id/profile_avatar"
android:layout_marginTop="20dp"
android:textColor="@color/neutralWhite"
android:textStyle="bold"
android:textSize="18sp"
android:text="Avatar Ang"/>
</RelativeLayout>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="4.04">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Hello Android!"/>
</RelativeLayout>
</LinearLayout>
Vielleicht andere zwicken, damit umzugehen? Vielen Dank
Wow, es funktioniert jetzt! : D Danke – fanjavaid
Dieser Show-Kreis –
@HardikJoshi meine Antwort vollständig lesen 'Sie können nicht einen Halbkreis aus XML erstellen. Aber Sie könnten erreichen, was Sie suchen, indem Sie einen Kreis mit geeignetem Rand und Polsterung verwenden. " – Gattsu