0

Hey I am working in line height in android. I used this answer to use lineSpacingExtra to set in textview. My designer want my textSize will be 16pt and height will be 24pt. Accordingly to above post, the answer will be 8sp. The problem is when the text is in two lines, the gap between is increase as double i.e. 16sp. Can some one guide me how to fix this problem.

<TextView
        android:id="@+id/description"
        style="@style/LightSlate16"
        android:layout_width="0dp"
        android:layout_height="wrap_content"
        app:layout_constraintEnd_toStartOf="@+id/testIcon"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toBottomOf="@+id/testName"
        tools:text="blah blah blah blah blah blah blah blah blah blah " />

style

<style name="LightSlate16" parent="TextAppearance.AppCompat">
        <item name="android:textColor">#ffaacc</item>
        <item name="android:fontFamily">@font/source_sans_variable_light</item>
        <item name="android:textSize">16sp</item>
        <item name="android:lineSpacingExtra">8sp</item>
</style>

As you can clearly shown that both line between space is double.

enter image description here

vivek modi
  • 880
  • 1
  • 8
  • 26

0 Answers0