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

  • Huot Media

    Huot Media

    7 Mayıs 2010
  • Lin Steven

    Lin Steven

    17 EKİM 2006
  • majesticdubstep

    majesticdubs

    3 Kasım 2011