简体   繁体   English

Xamarin Resource.designer.cs不为新添加文件生成引用

[英]Xamarin Resource.designer.cs not generating reference for newly add file

I am adding a file called citybase.png to my drawable folder when I set the src property of my ImageView to @drawable/citybase the image is not showing up in the design view. 当我将ImageView的src属性设置为@ drawable / citybase时,我在设计视图中没有显示图像时,我将一个名为citybase.png的文件添加到我的drawable文件夹中。 Inspecting the Resource.designer.cs class I realize that no reference is being generated for any files I add to the drawable folder(except for the default Icon of course). 检查Resource.designer.cs类我意识到没有为我添加到drawable文件夹的任何文件生成引用(当然除了默认的Icon)。

    public partial class Drawable
    {

        // aapt resource value: 0x7f020000
        public const int Icon = 2130837504;

        static Drawable()
        {
            global::Android.Runtime.ResourceIdManager.UpdateIdValues();
        }

        private Drawable()
        {
        }
    }

I tried rebuilding and cleaning the project but that does not work. 我尝试重建和清理项目,但这不起作用。 How can I fix this problem? 我该如何解决这个问题? (Xamarin Studio 4.2.3) (Xamarin Studio 4.2.3)

可绘制文件夹名称应为小写(在Visual Studio中,它在创建项目时始终使用名称'Drawable'创建),也避免使用诸如'@','#'等符号。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM