I got this code, a linearlayout inside relativelayout... however its not centering horizontally... any idea why?
i want the linearlayout to be horizontall centered. i am filling it with images via code.
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical" >
<RelativeLayout
android:id="@+id/relative1"
android:layout_width="match_parent"
android:layout_height="0px"
android:layout_weight="10"
android:background="@color/list_background_pressed" >
<LinearLayout
android:id="@+id/linear1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:layout_centerHorizontal="true" >
</LinearLayout>
<TextView
android:id="@+id/text2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:text="HI! Welcome to My Zain"
android:textColor="#ffffff" />
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@id/text2"
android:layout_centerHorizontal="true"
android:paddingTop="20dp"
android:src="@drawable/ico_profile_1_64x64" >
</ImageView>
</RelativeLayout>
<RelativeLayout
android:id="@+id/relative2"
android:layout_width="match_parent"
android:layout_height="0px"
android:layout_weight="10" >
<TextView
android:id="@+id/text5"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:text="The new Recharge Mechanism"
android:textColor="#000000" />
</RelativeLayout>
</LinearLayout>