SuperTextView-支持多种字体样式和图片混排

单个textview支持多种字体样式,支持插入图片

  • 下载和demo见GitHub:

GITHUB

SuperTextView-支持多种字体样式和图片混排_第1张图片

Add SuperTextView to your project

Gradle:

   compile 'cn.yzapp.supertextview:supertextview:[look download]@aar'

Maven:


  cn.yzapp.supertextview
  supertextview
  [look download]
  aar

Download

Use

RoundedStrokeSpan strokeSpan = new RoundedStrokeSpan(this, R.color.colorAccent, R.color.colorPrimary);
strokeSpan.setPadding(8, -8, 10, 18);

SuperTextView textView = (SuperTextView) findViewById(R.id.textview);
textView.addText("你好世界", new ForegroundColorSpan(getResources().getColor(R.color.colorAccent)),new StrikethroughSpan())
        .text("电话")
        .setSpan(strokeSpan)
        .setUrl("tel:0123456789")
        .setFontColor(getResources().getColor(R.color.colorPrimary))
        .add()
        .addImage(getResources().getDrawable(R.drawable.icon_city))
        .text("我的blog")
        .setUrl("http://blog.yzapp.cn")
        .setFontStyle(Typeface.BOLD_ITALIC)
        .setFontColor(getResources().getColor(R.color.colorPrimary))
        .add();

此为blog备份,原地址:http://blog.yzapp.cn/SuperTextView-支持多种字体样式和图片混排.html

你可能感兴趣的:(SuperTextView-支持多种字体样式和图片混排)