2
我想更改链接(textview)的默认颜色。如何更改android中可点击文本视图的颜色
SpannableString ss = new SpannableString("By continuing,I agree to HCP User Agreement and Terms of Services ");
ClickableSpan clickableSpan = new ClickableSpan() {
@Override
public void onClick(View textView) {
startActivity(new Intent(UserRegister.this, ForgotPassword.class));
}
};
ss.setSpan(clickableSpan, 48, 65, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
TextView textView = (TextView) findViewById(R.id.termsAndConditions);
textView.setText(ss);
textView.setMovementMethod(LinkMovementMethod.getInstance());
'ss.setSpan(new ForegroundColorSpan(Color.RED),48,65,Spannable.SPAN_EXCLUSIVE_EXCLUSIVE)' – Raghunandan
我有他们使用wordtoSpan.setSpan(new ForegroundColorSpan(Color.BLUE),15,30, Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);但那么我应该在哪里通过clickablespan对象 – Loren
http://stackoverflow.com/questions/15851655/android-change-the-background-color-of-a-clickablespan-when-clicked –