Hello all, I know i am doing a small mistake.
I am using LinearLayout and i want to place the "icon-image" at "Center". I am using the following code:
<LinearLayout
android:id="@+id/LinearLayout01"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
xmlns:android="http://schemas.android.com/apk/res/android">
<LinearLayout
android:id="@+id/LinearLayout02"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:layout_weight="0">
<ImageView
android:id="@+id/ImageView01"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/icon"
android:layout_gravity="center_vertical|center_horizontal|center">
</ImageView>
</LinearLayout>
<LinearLayout>
............
</LinearLayout>
</LinearLayout>
As you see above, i have also set layout_gravity
.
Now my problem is, if i set android:layout_width="wrap_context" instead of "fill_parent" in Child Linear Layout (i.e. LinearLayout02) then it works fine. but then whats should i do to set icon-image at Center while setting fill_parent
?
Pls anybody focus their knowledge and let me help to find out the mistake. Pls help me.
Thanx,
Paresh