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

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

  •  
  •   chturing184 · Apr 7, 2016 · 15201 views
    This topic created in 3675 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   ·   2433 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 27ms · UTC 15:49 · PVG 23:49 · LAX 08:49 · JFK 11:49
    ♥ Do have faith in what you're doing.