chturing184
V2EX  ›  Android

吐槽一下 Android TextView 一个很坑的问题: drawableRight 不能和文字一起居中

  •  
  •   chturing184 · Apr 7, 2016 · 15343 views
    This topic created in 3720 days ago, the information mentioned may be changed or developed.

    当 TextView 长宽较大时,想让 drawableRight 和文字一起居中显示,但是 android:gravity="center"对 drawableRight 不起作用!

    2 replies    2016-04-08 09:54:29 +08:00
    nekocode
        1
    nekocode  
       Apr 7, 2016   ❤️ 1
    drawableRight 本身就是在被设计为在 TextView 内容最右边显示的。要和文字一起居中的话请在文字中设置 ImageSpan 。
    chturing184
        2
    chturing184  
    OP
       Apr 8, 2016
    @nekocode 嗯,博客园有一个自定义的 TextView , drawable 可以和文字一起居中,但是有点 bug
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   3266 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 92ms · UTC 00:39 · PVG 08:39 · LAX 17:39 · JFK 20:39
    ♥ Do have faith in what you're doing.