Android Linkify links textColor ignored, css style overrides possible?

后端 未结 4 1848
耶瑟儿~
耶瑟儿~ 2020-12-31 18:55

I am using Linkify in my app, and visited link text is appearing as dark purple. My overall layout background color is dark blue so this is impossible to read.

4条回答
  •  一向
    一向 (楼主)
    2020-12-31 19:38

    I ran into the same problem using Linkify. You can use LinkMovementMethod instead, and convert your text to a SpannableString.

    TextView contactWeb1 = (TextView) findViewById(R.id.contactWeb1);
    SpannableString str = SpannableString.valueOf(contactWeb1);
    str.setSpan(new URLSpan(contactWeb1.getText()), 0, str.length() -1, Spannable.SPAN_INCLUSIVE_EXCLUSIVE);
    contactWeb1.setMovementMethod(LinkMovementMethod.getInstance());
    

提交回复
热议问题