SpannableStringBuilder spanSin = new SpannableStringBuilder();
SpannableString itemasin = new SpannableString(getResources().getString(R.string.lblasin)+"\n");
itemasin.setSpan(new AbsoluteSizeSpan(9, true), 0,itemasin.length(),0);
itemasin.setSpan(new ForegroundColorSpan(Color.parseColor("#EA7C07")), 0, itemasin.length(), Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
spanSin.append(itemasin);
SpannableString itemsin = new SpannableString(getResources().getString(R.string.lblSin));
itemsin.setSpan(new AbsoluteSizeSpan(12, true), 0,itemsin.length(),0);
spanSin.append(itemsin);
btnSin.setText(spanSin,BufferType.SPANNABLE);
同樣的邏輯也適用於按鍵的兩個字符串 – Pragnani 2013-03-25 05:38:39
http://stackoverflow.com/questions/12193785/different-textsizes-in-a-button這是什麼ü尋找對於。 – bostan 2013-03-25 05:46:17