英文:
TTF/Font file seen as error in Jetpack Compose project
问题
我想使用自定义字体,我下载了"Poppins"字体,并将TTF文件粘贴到新建的"font"文件夹中,它们下面有一条红线,可能是试图指示它们存在问题。我创建的"font"文件夹位于java/res/font。
我尝试在Google上查找此问题,但找不到任何相关信息。您能帮助我吗?我将附上层次结构和它们的外观照片。Android Studio没有提供任何关于可能问题的信息。感谢您的帮助。
英文:
I want to use a custom font, I downloaded the "Poppins" font and pasted the TTF files into the freshly made "font" folder and they have a red line under them, presumably trying to indicate that there is a problem with them. The "font" folder I made is located in java/res/font.
I tried to google the issue but I could not find anything about this. May you help me? I will attach a photo of the hierarchy and how they look. Android Studio doesn't give any info on what that may be. Thanks for looking into this.
答案1
得分: 0
大写字母和“-”字符在资源文件名中不允许使用。将文件名改为全部小写,并且可以用下划线“_”替换“-”。
英文:
Capital letters and -
chars are not allowed in resource file names. Rename the files to all lowercase, and you can replace the -
with underscore _
.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论