将singleLine设置为true时,Android onDraw不会在自定义TextView中绘制任何内容 [英] Android onDraw doesn't draw anything in custom TextView when setting singleLine to true

查看:212
本文介绍了将singleLine设置为true时,Android onDraw不会在自定义TextView中绘制任何内容的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我在项目中的自定义TextView的XML布局中将singleLine设置为true时,存在一个错误.我不知道该如何解决.有谁可以帮助我吗?

There is a bug when I set singleLine to true in the XML layout of my custom TextView in my project. I don't know how to fix it. Is there anyone who can help me?

github链接

推荐答案

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

这篇关于将singleLine设置为true时,Android onDraw不会在自定义TextView中绘制任何内容的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆