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

  • Joseph Herscher

    Joseph Hersc

    14 Mart 2007
  • RawBrahs

    RawBrahs

    28 Aralık 2010
  • Watcher3223

    Watcher3223

    15 Kasım 2007