【问题标题】:Android onDraw doesn't draw anything in custom TextView when setting singleLine to true将 singleLine 设置为 true 时,Android onDraw 不会在自定义 TextView 中绘制任何内容
【发布时间】:2016-02-23 01:31:29
【问题描述】:

当我在项目中自定义TextView 的XML 布局中将singleLine 设置为true 时出现错误。我不知道如何解决它。有没有人可以帮助我?

github link

【问题讨论】:

  • “什么都不画”是什么意思?例如调用 canvas.drawColor...
  • 为自定义 TextView 设置 singleLine true 导致自定义绘制无效。你可以在我的 github 项目中看到这个问题。 Here is Code
  • 这个问题导致了一个耗时 2 天的错误!!我很不高兴

标签: android textview android-custom-view


【解决方案1】:

最后,我改用android:maxLines="1"。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2011-09-07
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多