tags:

views:

77

answers:

2

Hi all,

In my application I need to set dynamic text to my textview so I want it to get resized dynamically. I have set:

< TextView

android:id="@+id/TextView02"

android:layout_width="fill_parent"

android:layout_height="wrap_content"

android:textStyle="normal"

android:layout_weight="1"

android:singleLine="false"

android:minLines="4" />

And from java code I am setting text of the textview at runtime..

My textview height is not going beyond 1 line and the text is getting cut. Can anybody please help?

Thanx in advance. And from java code I am setting text of the textview at runtime..

My textview height is not going beyond 1 line and the text is getting cut. Can anybody please help?

Thanx in advance.

A: 

In your android textView use the following attribute and it will solve your problem:

android:inputType="textMultiLine"

For eg:

<TextView
    android:inputType="text|textMultiLine"
    android:minLines="4"
    android:gravity="top"
    android:layout_width="fill_parent" 
    android:layout_height="wrap_content" 
    />
Megha Joshi
I tried this, but it doesn't works!
RATTLESNAKE
I have added a code sample..try it out.
Megha Joshi
A: 

Just try this, i do not know it will work or not... First try to fix the width just a normal text view

viv
like this <TextView android:layout_width="200dip" android:layout_height="wrap_content" />
viv