Dear Community
I've been struggling with a problem concerning Spannables. What I'm
trying to do is apply a AlignmentSpan.Standard(Alignment.ALIGN_NORMAL)
to the left portion of the text, and
AlignmentSpan.Standard(Alignment.ALIGN_OPPOSITE) to the right portion
of the text.
However, this does not work. ALIGN_OPPOSITE only makes a difference
when I apply it to the whole text.
Here's what I did:
TextView availableText = new TextView(this);
availableText.setText("left right",TextView.BufferType.SPANNABLE);
Spannable span = (Spannable) availableText.getText();
span.setSpan(new AlignmentSpan.Standard(Alignment.ALIGN_NORMAL),0, 4,
Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
span.setSpan(new AlignmentSpan.Standard(Alignment.ALIGN_OPPOSITE),5,
span.length()-1, Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
Can anyone shed some light on this? I am interested in knowing why it
doesen't work and also, if I'm on the wrong track here, an alternative
solution.
Thanks so much!
Cheers, Markus
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en