I am trying to create an EditText so that the space between each line should be like 20 dp . See image below.
If I use extra spacing, the cursor position is not aligned correctly with the line. I have reached the distance between the lines, but the cursor is not aligned with the line. See the red box highlighted in the image below.
package com.example.dev_task_197_keyboard_accesory; import android.content.Context; import android.graphics.Canvas; import android.graphics.Color; import android.graphics.Paint; import android.graphics.Rect; import android.util.AttributeSet; import android.widget.EditText; public class LineEditText extends EditText { private Rect mRect; private Paint mPaint;
For line spacing, add the lineSpaceExtra and lineSpaceMultiplier to the xml .
Please offer.

android android-edittext
Rahul gupta
source share