当我想自定义程序的通知图标时,这一切都开始了。图标位于 drawable
文件夹,我需要将它传递给 SetSmallIcon
用作整数类型(资源 ID)。
在我的 Xamarin.Android 项目中,我有文件 AboutResources.txt
带有以下提示:
In order to get the build system to recognize Android resources, set the build action to "AndroidResource". The native Android APIs do not operate directly with filenames, but instead operate on resource IDs. When you compile an Android application that uses resources, the build system will package the resources for distribution and generate a class called "Resource" that contains the tokens for each one of the resources included.
但是看不懂,哪里可以设置构建操作 .我在 Project 的选项中没有找到类似的东西。
可能是我错过了一些按钮或复选标记?
PS :
Visual Studio 2017
最佳答案
只需右键单击放入drawables文件夹的图标文件->您将能够看到“构建操作”选项
关于android - 我在哪里可以将构建操作设置为 "AndroidResource"?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/61168122/