在我的應用程序屏幕中,我想將標題顯示爲水平中心。我試圖與下面佈局XML代碼RelativeLayout中的TextView水平中心
<?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>
感謝
請參閱http://stackoverflow.com/questions/8767655/application-name-center-alignment-in-android/8767692#8767692 – NagarjunaReddy 2012-02-03 05:33:42
<?xml version =「1.0」encoding =「utf-8」?> <的RelativeLayout的xmlns:機器人= 「http://schemas.android.com/apk/res/android」 機器人:layout_width = 「FILL_PARENT」 機器人:layout_height = 「FILL_PARENT」 機器人:layout_marginTop = 「10dip」 > RelativeLayout的> –
Android
2012-02-03 05:47:07