I am using a spannable to create a string in 2 lines where each line has different font.
It works fine except one thing.
How can I add some margin between the first string with the second string?
So I do:
String a = "First line";
String b = "Second line";
SpannableString spannableName = new SpannableString(a + "\n" + b);
spannableName.setSpan(new TextAppearanceSpan(activity, R.style.my_style),0,a.length(), 0);
and my_style
<style name="my_style">
<item name="android:layout_marginBottom">100dp</item>
<item name="android:paddingBottom">10dp</item>
<item name="android:textSize">@dimen/size</item>
<item name="android:textColor">@color/mycolor</item>
</style>
What am I doing wrong?
I want to have some padding/margin between a
and b
.
The paddings/margins in my style are big because I wasn't sure if they are applied or not (test numbers)