Reputation: 2253
I have one textview which size is 50 dp. I got this result like the picture below.
I want to remove bottom spaces in my textView ,because its height depend on the text size. And I want to receive background only into my quotation mark.
Is there any way to remove the unused spaces in my textView?
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:gravity="top"
android:text="“"
android:fontFamily="@font/arialbd"
android:background="#ff0"
android:textColor="#E8E9EF"
android:includeFontPadding="false"
android:textSize="50dp" />
Upvotes: 1
Views: 4249
Reputation: 1204
This solution works on my case. To remove bottom padding. Set the layout_height
the same size as your textSize
or 1dp or 2dp less.
Set includeFontPadding="false"
. Set android:lineSpacingExtra="0dp"
Upvotes: 1
Reputation: 394
Try this:
<TextView
android:layout_width="wrap_content"
android:layout_height="30dp"
android:layout_gravity="top|center"
android:text="“"
android:fontFamily="@font/arialbd"
android:background="#ff0"
android:textColor="#E8E9EF"
android:includeFontPadding="false"
android:textSize="50dp"
android:gravity="top" />
Upvotes: 1
Reputation: 1825
In your case you have to implement custom textView. check this example for reference.
Upvotes: 0
Reputation: 427
U can try setting your bottom margin to a negative value.
Something like this:
android:layout_marginBottom="-10dp"
Let me know if its works, that is the simplest way but can be anothers...
Upvotes: -1