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

  • Bryan Adams

    Bryan Adams

    30 Mart 2006
  • Edgar flores

    Edgar flores

    7 HAZİRAN 2006
  • steven johns

    steven johns

    11 Mart 2011