Android - Add Margin for SpannableStringBuilder using ReplacementSpan
问题 I'm trying to format Hashtags inside a TextView/EditText (Say like Chips mentioned in the Material Design Specs). I'm able to format the background using ReplacementSpan . But the problem is that I'm not able to increase the line spacing in the TextView/EditText. See the image below The question is how do I add top and bottom margin for the hashtags? Here is the code where I add the background to the text: /** * First draw a rectangle * Then draw text on top */ @Override public void draw