AnTz
AnTz

Reputation: 127

Wrap_content starting a new line

I don't really know what should I search for so that is why I decided to ask here. I have a TextView which I want it to wrap by my content but not to exceed the application width, instead to start a new line and push the View below it one line beneath.

I believe it's a simple answer and I will be glad if someone will provide it to me! Thanks!

Upvotes: 0

Views: 270

Answers (3)

Kumar Vivek Mitra
Kumar Vivek Mitra

Reputation: 33534

1. Please do set the width as wrap_content and height also as wrap_content.

2. Keep margin and padding to maintain the distance between other views, in you want the data to be in new line and Not using max line = 1

3. If you dont want to to create a new line, then use the attribute max line = 1, this will keep adding to the TextView all in one line.

Upvotes: 1

Serdar Samancıoğlu
Serdar Samancıoğlu

Reputation: 740

Try this:

android:singleLine="false"

Upvotes: 1

Chitranshu Asthana
Chitranshu Asthana

Reputation: 1089

set width as match_parent and height as wrap_content.

Upvotes: 2

Related Questions