سؤال

I have to draw mathematical equations like x - (20 * x)/100 in TextView and it has to seems like this:

enter image description here

I use ReplacementSpan to add fraction on the baseline of TextView.But it seems that mathematical operators do not aligned respect to the base line of TextView.So result is like this:

enter image description here

Now I want to know how I can find the baseline of mathematical operator to align the fraction with respect to it?

enter image description here

هل كانت مفيدة؟

المحلول

use

Paint.getTextBounds with "-" text
مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top