V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
Gloomyer
V2EX  ›  Android

TextView,使用 SpannableString 后导致文字显示错乱

  •  1
     
  •   Gloomyer · Sep 18, 2016 · 13396 views
    This topic created in 3509 days ago, the information mentioned may be changed or developed.

    ##问题概述##
    TextView,使用 SpannableString 后导致文字显示错乱
    ##细节##
    没有任何限制的 TextView
    使用了 SpannableString 用于分析和点击响应 url
    之后 点击了这个 url.
    然后设置 TextView 的 MaxLines 为 5(全文 /收起)
    就变成了这样
    ##效果图##

    Supplement 1  ·  Sep 19, 2016

    2 replies    2016-10-08 14:14:57 +08:00
    Gloomyer
        1
    Gloomyer  
    OP
       Sep 19, 2016
    问题已经结局,详情请移步至: http://www.gloomyer.com/2016/09/19/android-fulltext02/
    ruidge
        2
    ruidge  
       Oct 8, 2016   ❤️ 1
    建议研究研究 textview 的各种 span 的实现和 LinkMovementMethod 的源码.这个最好的方法是替换某层父类的 scroller 的 scroll 相关方法
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   3309 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 30ms · UTC 13:09 · PVG 21:09 · LAX 06:09 · JFK 09:09
    ♥ Do have faith in what you're doing.