TextView的用法
来源:互联网 发布:360数据恢复电脑免费版 编辑:程序博客网 时间:2024/06/16 02:41
1、textView设置两种不同颜色字体、大小
TextView textView = new TextView(context);SpannableString styleText = new SpannableString("审批编号:" + bean7006.getData().getUserSchoolFlowOrder().getId());styleText.setSpan(new TextAppearanceSpan(this, R.style.style0), 0, 5, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);styleText.setSpan(new TextAppearanceSpan(this, R.style.style1), 5, String.valueOf(bean7006.getData().getUserSchoolFlowOrder().getId()).length() + 5, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);textView.setText(styleText, TextView.BufferType.SPANNABLE);LinearLayout.LayoutParams ll = new LinearLayout.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT);ll.setMargins(0, 10, 0, 0);linearSection.addView(textView, ll);*引用的R.style.style0和R.style.style1为:
<style name="style0"> <item name="android:textSize">14sp</item> <item name="android:textColor">@color/textcolorgary</item></style><style name="style1"> <item name="android:textSize">14sp</item> <item name="android:textColor">@color/textcolor</item></style>
阅读全文
0 0
- 控件TextView的用法
- TextView的多种用法
- Andrtoid TextView的用法
- TextView的高级用法
- TextView的用法
- android 中 TextView的用法
- iOS textview的基础用法
- TextView的一些属性用法
- textview用法
- iOS 的TextView的常规用法
- Android: TextView常用属性的用法详解
- TextView容易被忽视的用法总结
- Android TextView的一些特殊用法
- TextView—SpannableString的简单用法
- Android的TextView与Html相结合的用法
- Android的TextView与Html相结合的用法
- textView用法技巧
- android TextView用法
- Linux 命令 之 lsof
- Linux 线程同步的三种方法
- git SSH Key 生成步骤
- union内嵌struct用法
- 水仙花数 HDU-2010
- TextView的用法
- 图解SQL的JOIN
- Android7.0 6.0 相机拍照,系统裁剪适配问题
- JDK1.8与JDK1.7环境的切换
- 【surrounded-regions】
- 《大话设计模式》简读
- SSH综合项目实战(快递) -- day03 EasyUI之datagrid、收派标准管理、收派员管理
- 关于<param-value>中的classpath和classpath*的零碎总结
- scala创建动态二维数组Array[ArrayBuffer[]]三种写法