1. 程式人生 > >URLSpan 字型顏色修改

URLSpan 字型顏色修改

		SpannableString ss = new SpannableString(
				getString(R.string.tv_inkanet_protocol));
		ss.setSpan(new URLSpan("inkanet.pateo.com.cn"), 0,
				getString(R.string.tv_inkanet_protocol).length(),
				Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
		ss.setSpan(new ForegroundColorSpan(Color.RED), 0, getString(R.string.tv_inkanet_protocol).length(), Spanned.SPAN_EXCLUSIVE_EXCLUSIVE); 
		tv_protocol.setText(ss);