着重样式。
构造函数:
示例1:
BulletSpan bulletSpan = new BulletSpan(100);
//BulletSpan bulletSpan = new BulletSpan(100, Color.RED);
String text = "打开百度";
SpannableString spannableString = new SpannableString(text);
spannableString.setSpan(bulletSpan, 2, text.length(), Spanned.SPAN_INCLUSIVE_INCLUSIVE);
TextView textView = (TextView) findViewById(R.id.text_view);
textView.setText(spannableString);
示例2:
Parcel parcel = Parcel.obtain();
parcel.writeInt(20);//设置gapWidth
parcel.writeInt(1);//设置是否使用颜色
parcel.writeInt(Color.YELLOW);//设置颜色
parcel.setDataPosition(0);
AbsoluteSizeSpan absoluteSizeSpan = new AbsoluteSizeSpan(parcel);
String text = "打开百度";
SpannableString spannableString = new SpannableString(text);
spannableString.setSpan(absoluteSizeSpan, 2, text.length(), Spanned.SPAN_INCLUSIVE_INCLUSIVE);
TextView textView = (TextView) findViewById(R.id.text_view);
textView.setText(spannableString);