TextView centre horizontal dans RelativeLayout

Dans mon écran d'application, je veux montrer à en-Tête horizontalement centre. J'ai essayé avec dessous de la mise en page xml codes

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
  android:layout_width="fill_parent"
  android:layout_height="fill_parent"
  android:layout_marginTop="10dip"
  >
  <TextView
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:gravity="center_horizontal"
    android:text="Connections" />
</RelativeLayout>

grâce

  • voir stackoverflow.com/questions/8767655/...
  • <?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent" android:layout_marginTop="10dip" > <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_centerHorizontal="true" android:text="Connexions" /> </RelativeLayout>
InformationsquelleAutor Riskhan | 2012-02-03