TextView tv = new TextView(this);
tv.setText(Html.fromHtml("<font color=/"#ff0000/">红色</font>其它颜色"));
(2)popup window
a>首先从layout文件(hello.xml)文件得到view。
View view = this.getLayoutInflater().inflate(R.layout.hello, null);
b>然后用inflate得到的view布局生成PopupWindow
pop = new PopupWindow(view, 500, 200);
c> 下拉方式show: pop.showAsDropDown(v);
指定位置show:pop.showAtLocation(findViewById(R.id.main), Gravity.CENTER, 20, 20);
d>关闭PopUpWindow
pop.dismiss();