【发布时间】:2017-06-28 06:28:00
【问题描述】:
我正在使用 Xamarin 在 Android 上开发启动画面。我有一张名为“splash1.jpg”的图片放在我的各种可绘制子文件夹中,其中包含子文件夹“splash”。因此,例如,我有一个“resources/drawable-hdpi/splash/splash1.jpg”和一个“resources/drawable-mdpi/splash/splash1.jpg”。
在我的 main.axml 布局中,我有一行用于 imageview 源
android:src="@drawable/splash/splash1"
以下行是在我的 resources.cs 文件中自动生成的
public const int splash/splash1 = 2130837505;
splash/slash1 常量名称中的斜杠有错误,导致编译时出现多个错误。
当我的文件位于drawable文件夹的子目录中时,我应该如何在drawables中引用我的文件?
谢谢。
【问题讨论】:
-
你能把我的答案标记为正确吗?