jfxu
jfxu

Reputation: 690

Android TextView linespacing

How to set the line spacing of TextView to 0?
I have tried:

android:lineSpacingExtra="0dp";

But it dosen't work, I know set the value to negtive will solve this problem
Is there any other solution to this problem?

Upvotes: 0

Views: 699

Answers (4)

Nitesh Pareek
Nitesh Pareek

Reputation: 362

from code you can use textView.setLineSpacing() or from xml you can use android:lineSpacingExtra

Upvotes: 0

Darko Bacic
Darko Bacic

Reputation: 158

You can use:

android:lineSpacingMultiplier="0.8"

If the gap is still big use a smaller value than 0.8.

Upvotes: 1

Haroon Chhipa
Haroon Chhipa

Reputation: 27

You can use

android:lineSpacingExtra

and

android:lineSpacingMultiplier 

in your XML file.

Upvotes: 2

Dharmaraj
Dharmaraj

Reputation: 1306

also use

 android:lineSpacingMultiplier="0dp"

Upvotes: 0

Related Questions