Android 同个TextView设置字体大小不一样

 private SpannableString changTvSize(String value) {

        SpannableString spannableString = new SpannableString(value);
        if (value.contains(".")) {
            spannableString.setSpan(new RelativeSizeSpan(0.5f), value.indexOf("."), value.length(), Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
        }
        return spannableString;
    }

 

你可能感兴趣的:(android)