光栅效果。
RasterizerSpan(Rasterizer r):Rasterizer只有一个系统定义了的子类LayerRasterizer。
示例:
LayerRasterizer layerRasterizer = new LayerRasterizer();
Paint paint = new Paint();
paint.setColor(Color.RED);
layerRasterizer.addLayer(paint, 10, 10);
RasterizerSpan rasterizerSpan = new RasterizerSpan(layerRasterizer);
String text = "打开百度";
SpannableString spannableString = new SpannableString(text);
spannableString.setSpan(layerRasterizer, 2, text.length(), Spanned.SPAN_INCLUSIVE_INCLUSIVE);
TextView textView = (TextView) findViewById(R.id.text_view);
textView.setText(spannableString);