Je travaille sur une mise en page d'écran assez basique pour ma première application Android et je rencontre quelques problèmes. Mon but est d'avoir un TextView dans le coin en haut à gauche et en haut à droite, un grand TextView "hello world" au milieu de l'écran, puis un bouton en bas de l'écran. Mon problème est, pour centrer le "hello world" TextView verticalement, je dois définir layout_height = "fill_parent". Cependant, cela provoque la couverture du TextView central et masque le bouton au bas de l'écran. Y a-t-il une meilleure façon de faire cela que ce que j'essaie actuellement? J'ai joint mon ui xml ci-dessous. Merci!Android Center Layout Hiding Button
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:gravity="center_horizontal">
<TableLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:stretchColumns="1">
<TableRow>
<TextView
android:text="@string/label_left" />
<TextView
android:text="@string/label_right"
android:gravity="right" />
</TableRow>
</TableLayout>
<TextView
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:text="@string/hello_world"
android:gravity="center"
android:textSize="40sp" />
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/next_activity"
android:gravity="center"
android:textSize="30sp" />
</LinearLayout>
Cela a parfaitement fonctionné. Merci! – Blather