Quantcast
Channel: Recent Threads — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 204402

Text Alignment with SpannableString

$
0
0

Referencing this post I've tried to use a SpannableString to align items within a TextView:

var rightLeft = "right left";
            var spanString = new SpannableString(rightLeft);
            spanString.SetSpan(new AlignmentSpanStandard(Layout.Alignment.AlignOpposite), 5, 
rightLeft.Length, SpanTypes.ExclusiveExclusive);
            spanString.SetSpan(new AlignmentSpanStandard(Layout.Alignment.AlignNormal), 0, 5, 
SpanTypes.ExclusiveExclusive);
            var tv2 = new TextView(this);
            tv2.LayoutParameters = new ViewGroup.LayoutParams(400, 100);
however I can't get the desired right/left span result.

Any suggestions?


Viewing all articles
Browse latest Browse all 204402

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>