Q:

Formatting Text in TextView

I had two textview in a linearlayout. In one textview, text contains 21 characters and in another textview, text contains only 12 characters. The first textview is shown in two lines and the second textview is shown in single line. I want both textview text should be same either in single or double line. 
I used the following code: 
<LinearLayout
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:layout_marginTop="10dp" >

    <TextView
        android:id="@+id/tvtextview1"
        android:layout_width="fill_parent"
        android:layout_height="50dp"
        android:layout_margin="1dp"
        android:layout_weight="1"
        android:inputType="textMultiLine"
        android:scrollHorizontally="false"
        android:gravity="center"
        android:textColor="#FFFFFF"
        android:textSize="16sp" >
    </TextView>

    <TextView
        android:id="@+id/tvtextview2"
        android:layout_width="fill_parent"
        android:layout_height="50dp"
        android:layout_margin="1dp"
        android:layout_weight="1"
        android:scrollHorizontally="false"
        android:gravity="center"
        android:inputType="textMultiLine"
        android:textColor="#FFFFFF"
        android:textSize="16sp">
    </TextView>
</LinearLayout>

Can anyone please help me to solve this? Thanks in advance.

A:

If you want both of them to be single line use android:singleLine="true" : 

<TextView
    android:layout_margin="10dip"
    android:layout_width="0dip"
    android:layout_height="wrap_content"
    android:layout_weight="1"
    android:ellipsize="marquee"
    android:marqueeRepeatLimit="marquee_forever"
    android:singleLine="true"
    android:text="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
    android:textSize="16sp" />

<TextView
    android:layout_margin="10dip"
    android:layout_width="0dip"
    android:layout_height="wrap_content"
    android:layout_weight="1"
    android:ellipsize="marquee"
    android:marqueeRepeatLimit="marquee_forever"
    android:singleLine="true"
    android:text="xxxxxxxxxxxxxxxxxxxxxxxx"
    android:textSize="16sp" />

A:

add android:minLines="2" in both <TextView> tags.

