使用 MonoDevelop 和 IB 处理图像...对此感到非常沮丧...
我对 MD 和 IB 似乎不能很好地与图像一起工作感到非常沮丧。让我解释一下。
我们的 iPad 应用程序有特定的外观和感觉,并且大多数控件都有某种与之关联的图像(无论是通过 .CS 代码还是在 IB 中分配)。
当我将图像导入到 MonoDevelop 项目中的“图像”文件夹中时,我双击 XIB 以在 IB 中打开并以可视方式使用视图。我期望在我的 ImageView 的图像下拉列表中看到我刚刚导入 MD 的图像...但是,我没有,而且我还看到了对项目中不再存在的图像的引用(我已经删除了)。
Xcode/IB 中是否有某种我没有使用的缓存机制?我已经尝试了我能想到的一切...全部清理...在 MD 中构建全部...在 IB 中清理...似乎没有什么可以帮助将我的项目列表从 MD 同步到 IB...删除图像...重新导入导入 MD...导入 IB...似乎没有什么可以触发这些文件的“同步”。
另一个人正在研究这个项目,最后只是将图像转储到项目的根目录中,这是我不喜欢的(因为我不希望我的其他开发人员不得不费力地浏览成堆的 JPG/PNG 文件)...所以我(假设 MD 至少足够聪明,可以保持引用完整)将项目根目录中的图像拖放到所述“图像”文件夹中......现在我们的 IB 分配的图像都不会出现在 iPad 应用程序中,我们得到一个
“无法加载引用的图像 捆绑包中的笔尖带有标识符“com.yourcompany.comassipad””
项目中每个图像上的
错误。拜托,出于对所有神圣事物的热爱,有人可以向我解释一下吗?我对此感到困惑和沮丧。
I am very frustrated with how MD and IB seem to not work well together with imagery. Let me explain.
We have a specific look and feel for our iPad app, and most of our controls have some sort of image associated to it (whether that be through .CS code or assigned in IB).
When I import an image into an "images" folder in the project in MonoDevelop, I double click my XIB to open in IB and work with the view visually. I expect to see that image that I just imported into MD in the Image drop down for my ImageView... however, I do not and I also see references to images that are no longer in the project (that i have deleted).
Is there some sort of cache mechanism in Xcode/IB that I am not using? I have tried everything i can think of... Clean All... Build All in MD... Clean in IB... nothing seems to help synchronize my project listings from MD to IB... remove image... reimport into MD... import into IB... nothing seems to trigger a "synchronization" of these files.
Another person was working on the project and just ended up dumping imagery into the root of the project, which I do not like (since I don't want my other developers to have to wade through piles of JPG/PNG files)... so I (assuming MD was at least smart enough to keep references intact) dragged and dropped the images in the root of the project to said "images" folder.... now none of our IB assigned images appear in the iPad app and we get an
"Could not load the image referenced from a nib in the bundle with identifier "com.yourcompany.compassipad""
error on each image in the project.
Please, for the love of all things holy, can someone explain this to me? I am perplexed and frustrated by this.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
Xcode 要求图像资源位于顶级文件夹中,因为它通过基本名称而不是相对路径来引用它们。
目前,解决方法是始终将图像也放在 MonoDevelop 项目的顶层。
我们计划在 MonoDevelop 中实现一个“Resources”文件夹,供您放置您需要 Xcode 能够引用的图像和其他资源,以便您可以保持顶级目录更干净,但尚未实现。
至于 Xcode 下拉菜单中出现的旧图像,我不确定那里发生了什么。您可以尝试删除项目中的“obj”目录(它保存临时目标文件和临时 Xcode 项目)。当您双击 .xib 时,MonoDevelop 将重新创建此文件夹并生成一个新的 Xcode 项目。
Xcode requires that image resources be in the toplevel folder because it refers to them by basename rather than their relative path.
For now, the workaround is to always put your images in the toplevel of your MonoDevelop project, too.
We plan to implement a "Resources" folder in MonoDevelop for you to put your images and other resources that you need Xcode to be able to refer to, so that you can keep your toplevel directory cleaner, but it hasn't been implemented yet.
As far as old images appearing in the dropdowns in Xcode, I'm not sure what is going on there. You could try deleting the 'obj' directory in your project (it holds temporary object files and the temporary Xcode project). MonoDevelop will recreate this folder and generate a new Xcode project when you double-click a .xib.