This is my XML for showing user's information on the ListView, So currently it contains two TextView on which I am showing user’s information.
Problem Statement:-
Whenever I run my application, I always see both of my Text View coming side by side. For example I always get something like below-
SomeImage TextView1 TextView2
Which is what I don’t want. I need something like this- And suppose if I have three TextView in future.
SomeImage TextView1
TextView2
TextView3
And below is my XML file which I am using currently. How can I modify this so that I always get the required output I need?
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="wrap_content" >
<ImageView
android:id="@+id/image"
android:layout_width="50dip"
android:layout_height="50dip"
android:scaleType="centerCrop"
android:src="@drawable/stub" />
<TextView
android:id="@+id/text"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_gravity="left|center_vertical"
android:layout_marginLeft="10dip"
android:layout_weight="1"
android:textSize="10dip" />
<TextView
android:id="@+id/text1"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_gravity="left|center_vertical"
android:layout_marginLeft="10dip"
android:layout_weight="1"
android:textSize="10dip" />
</LinearLayout>
Try this: