今天发现用一个TextView实现两种文字颜色的简便方法。
TextView test = (TextView) findViewById(R.id.test);
String twoColor = "颜色测试"+"<font color='#e60012'>"+"红色"+"</font>";
test.setText(Html.fromHtml(twoColor));
写起来真的超级简单,记录一下。
今天发现用一个TextView实现两种文字颜色的简便方法。
TextView test = (TextView) findViewById(R.id.test);
String twoColor = "颜色测试"+"<font color='#e60012'>"+"红色"+"</font>";
test.setText(Html.fromHtml(twoColor));
写起来真的超级简单,记录一下。