0
我正在使用線性佈局將我的不同元素放置在我的視圖中。在這一個,我把一個相對的佈局設置水平中心到一個textView。這是我的看法代碼:將水平中心設置爲處於線性佈局的相對平整的textView
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="com.selectionModele.seguin_android.SelectionModeleActivity"
android:background="@drawable/selection_modele_fond"
android:orientation="vertical">
<ImageView
android:id="@+id/imageView1"
android:layout_width="120dp"
android:layout_height="46dp"
android:layout_marginTop="34dp"
android:layout_marginLeft="200dp" />
<RelativeLayout
android:layout_marginTop="20dp"
android:layout_width="match_parent"
android:layout_height="wrap_content" >
<TextView
android:id="@+id/selection_modele_textView_famille"
android:layout_width="280dp"
android:layout_height="36dp"
android:textSize="20dp"
android:layout_centerHorizontal="true"/>
</RelativeLayout>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content" >
<android.support.v4.view.ViewPager
android:id="@+id/selection_news_viewPager"
android:layout_width="320dp"
android:layout_centerHorizontal="true"
android:layout_height="308dp">
</android.support.v4.view.ViewPager>
</RelativeLayout>
但是當我啓動我的申請,我的TextView不是中心,我不爲什麼? 我該如何解決問題?
謝謝,我TextView的是一箇中心,但裏面的文字是不... – theMouk 2013-03-06 15:42:52