Je souhaite dessiner du texte sur un rectangle à l'aide de xml. Je veux que le texte soit centré sur le rectangle. Le rectangle et le texte sont à la fois dans une grille pour une raison.textview centré sur le rectangle
<GridLayout
android:id="@+id/daily"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:columnCount="3"
android:orientation="horizontal"
android:rowCount="1" >
<TextView android:background="@drawable/green_rect_small" />
<Space android:layout_width="3dp" />
<RelativeLayout>
<View
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/green_rect_large" />
<TextView
android:id="@+id/daily_readings"
android:background="@drawable/green_rect_large"
android:text="@string/daily_readings"
android:textColor="@color/white"
android:textSize="40sp" />
</RelativeLayout>
</GridLayout>
Je ne peux pas l'obtenir fait si je mets le rectangle comme bg de l'affichage du texte ou une vue séparée. Où ai-je tort?
Merci pour votre ramaral de réponse. –