《第一行代码Android2版》笔记五:Boolean types not allowed (at 'maxLines' with value 'true').

版权声明:原创文章,转载请注明: 转载自 DT-IOT的博客https://blog.csdn.net/weixin_41213648 https://blog.csdn.net/weixin_41213648/article/details/89429863

在操作实践4.5节的时候,遇到错:Boolean types not allowed (at 'maxLines' with value 'true').

如下图

根据错误日志提示可知,在此maxLines变量是Boolean(布尔型)变量,不能用True/False表示;那只能用布尔型变量的另一种形式1/0来表示了。将Android:maxLines="true",改成Android:maxLines="1";问题就解决了,运行结果如下图。

猜你喜欢

转载自blog.csdn.net/weixin_41213648/article/details/89429863