Je suis actuellement occupé avec une page de détails. Je me demandais maintenant comment je pourrais faire ressembler un cardview à celui que j'ai conçu. Je n'arrive pas à trouver sur google comment le faire. Je veux que la carte soit multicolore: 25% du haut devrait être blanc, et le 75 restant au bas devrait être rouge. Comment puis-je le faire? Je pensais à des drawables, mais je pense que ça aura l'air moche avec différents téléphones.Cardview avec plusieurs couleurs d'arrière-plan
je le veux ressembler à ceci:
Je possède ce Vignettes:
<android.support.v7.widget.CardView
android:id="@+id/view4"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="8dp"
android:layout_marginLeft="16dp"
android:layout_marginRight="16dp"
android:layout_marginTop="24dp">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/material_grey_50"
android:orientation="vertical">
<TextView
style="@style/TextViewAppearance.Body3"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="16dp"
android:layout_marginTop="16dp"
android:text="Descriptie"
android:textColor="?attr/colorPrimaryDark" />
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_marginLeft="8dp"
android:layout_marginRight="8dp"
android:layout_marginTop="8dp"
android:background="@color/material_grey_200" />
<TextView
android:id="@+id/descriptionText"
style="@style/TextViewAppearance.Body2"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="16dp"
android:layout_marginLeft="16dp"
android:layout_marginRight="16dp"
android:layout_marginTop="16dp"
android:textColor="@color/material_grey_600" />
</LinearLayout>
</android.support.v7.widget.CardView>