SORU
22 AĞUSTOS 2010, Pazar


Android alt simge ve Üst Simge bir Dize

Nasıl alt simge veya üst simge ile bir dize yazdırır mısın? Harici bir kütüphane olmadan bunu yapabilir misin? Bu Android TextView bir görüntü istiyorum.

CEVAP
15 Ocak 2012, Pazar


Örnek:

equation = (TextView) findViewById(R.id.textView1);
SpannableStringBuilder cs = new SpannableStringBuilder("X3   X2");
cs.setSpan(new SuperscriptSpan(), 1, 2, Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
cs.setSpan(new RelativeSizeSpan(0.75f), 1, 2, Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
cs.setSpan(new SuperscriptSpan(), 6, 7, Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
cs.setSpan(new RelativeSizeSpan(0.75f), 6, 7, Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
equation.setText(cs);

Bunu Paylaş:
  • Google+
  • E-Posta
Etiketler:

YORUMLAR

SPONSOR VİDEO

Rastgele Yazarlar

  • boburnham

    boburnham

    11 Temmuz 2006
  • GoldgenieOfficial

    GoldgenieOff

    23 Temmuz 2009
  • Matt Harding

    Matt Harding

    23 Mayıs 2006