在此问题之前我无法更改我的代码 . 但是,当我构建我的项目时就会发生这种情况 . 我无法解决和理解它是什么?请问你能帮帮我吗?我使用Android Studio 3.2.1
Output:
C:\Users\Lenovo\AndroidStudioProjects\Paintmet\app\src\main\res\drawable-
v24\ic_launcher_foreground.xml:7: error: '1' is incompatible with attribute
textSize (attr) dimension.
v21\ic_launcher_background.xml:10: error: '0.8' is incompatible with
attribute textSize (attr) dimension.
...
2 回答
最后我找到了答案 . 答案是删除res文件夹中的drawable文件夹 . 然后复制到其他项目drawable文件夹到那里 .
您需要一个单位,例如
sp
,dp
或px
.建议使用
sp
作为文本,因为它将与系统字体大小和系统密度一起缩放 . 但是,1
和0.8
会很小 . 你至少需要14sp
.