Bug 20159 - Image for UIImageView showing in designer but not in app.
Summary: Image for UIImageView showing in designer but not in app.
Status: RESOLVED FIXED
Alias: None
Product: Visual Studio Extensions
Classification: Xamarin
Component: iOS Designer ()
Version: 3.0
Hardware: PC Windows
: Normal normal
Target Milestone: ---
Assignee: Jose Medrano
URL:
Depends on:
Blocks:
 
Reported: 2014-05-29 14:44 UTC by Jon Goldberger [MSFT]
Modified: 2014-09-30 12:33 UTC (History)
10 users (show)

Tags:
Is this bug a regression?: ---
Last known good build:

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.


Please create a new report on Developer Community with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:
Status:
RESOLVED FIXED

Description Jon Goldberger [MSFT] 2014-05-29 14:44:26 UTC
When setting an image that is in a folder for a UIIMageView in the designer, the image shows in the designer but does not show in the app. This seems to be due to path style discrepancy between windows and the rest of the world. To reproduce:

1. Place an image, image.jpg, in a folder in the root of the project, let's call the folder Images.
2. In iOS Designer, add a UIImageView and set it's image to the above added image.
3. Note the path used is Images\image.jpg with the backslash
4. Launch the app.

Expected result: the image will display

Actual result: the image does not display

Setting the path to the image in iOS designer to Images/image.jpg causes the image to be shown in the app but not in the iOS designer.

IOW, I believe this is a path style discrepancy between using backslashes and forward slashes. 

------------------------------------------
My version information:

Microsoft Visual Studio Ultimate 2013
Version 12.0.21005.1 REL
Microsoft .NET Framework
Version 4.5.51641

Installed Version: Ultimate

Architecture and Modeling Tools   06181-004-0451031-02209
Microsoft Architecture and Modeling Tools
    
UML® and Unified Modeling Language™ are trademarks or registered trademarks of the Object Management Group, Inc. in the United States and other countries.

LightSwitch for Visual Studio 2013   06181-004-0451031-02209
Microsoft LightSwitch for Visual Studio 2013

Microsoft Office Developer Tools for Visual Studio 2013 ENU   06181-004-0451031-02209
Microsoft Office Developer Tools for Visual Studio 2013 ENU

Team Explorer for Visual Studio 2013   06181-004-0451031-02209
Microsoft Team Explorer for Visual Studio 2013

Visual Basic 2013   06181-004-0451031-02209
Microsoft Visual Basic 2013

Visual C# 2013   06181-004-0451031-02209
Microsoft Visual C# 2013

Visual C++ 2013   06181-004-0451031-02209
Microsoft Visual C++ 2013

Visual F# 2013   06181-004-0451031-02209
Microsoft Visual F# 2013

Visual Studio 2013 Code Analysis Spell Checker   06181-004-0451031-02209
Microsoft® Visual Studio® 2013 Code Analysis Spell Checker

Portions of International CorrectSpell™ spelling correction system © 1993 by Lernout & Hauspie Speech Products N.V. All rights reserved.

The American Heritage® Dictionary of the English Language, Third Edition Copyright © 1992 Houghton Mifflin Company. Electronic version licensed from Lernout & Hauspie Speech Products N.V. All rights reserved.

Windows Phone SDK 8.0 - ENU   06181-004-0451031-02209
Windows Phone SDK 8.0 - ENU

ASP.NET Web Frameworks and Tools 2012.2   4.1.21001.0
For additional information, visit http://go.microsoft.com/fwlink/?LinkID=309563

ASP.NET Web Frameworks and Tools 2013   5.0.11001.0
For additional information, visit http://www.asp.net/

Common Azure Tools   1.0
Provides common services for use by Azure Mobile Services and Windows Azure Tools.

Microsoft Advertising SDK for Windows Phone   
Microsoft Advertising SDK for Windows Phone
Build 

Microsoft Web Developer Tools 2013   2.0.40926.0
Microsoft Web Developer Tools contains the following components:
Support for creating and opening ASP.NET web projects
Browser Link: A communication channel between Visual Studio and browsers
Editor extensions for HTML, CSS, and JavaScript
Page Inspector: Inspection tool for ASP.NET web projects
Scaffolding: A framework for building and running code generators
Server Explorer extensions for Windows Azure Web Sites
Web publishing: Extensions for publishing ASP.NET web projects to hosting providers, on-premises servers, or Windows Azure

NuGet Package Manager   2.7.40911.287
NuGet Package Manager in Visual Studio. For more information about NuGet, visit http://docs.nuget.org/.

PreEmptive Analytics Visualizer   1.2
Microsoft Visual Studio extension to visualize aggregated summaries from the PreEmptive Analytics product.

SQL Server Data Tools   12.0.30919.1
Microsoft SQL Server Data Tools

Windows Azure Mobile Services Tools   1.0
Windows Azure Mobile Services Tools

Workflow Manager Tools 1.0   1.0
This package contains the necessary Visual Studio integration components for Workflow Manager.

Xamarin   3.0.54.0 (d3cf238e3845e930e312b6ec9b4c6c5437c33067)
Visual Studio extension to enable development for Xamarin.iOS and Xamarin.Android

Xamarin.Android   4.12.4.20 (b5dc5ce91305e19de51d71a1122c109719c4bc34)
Visual Studio plugin to enable development for Xamarin.Android.

Xamarin.iOS   3.0.54.0 (d3cf238e3845e930e312b6ec9b4c6c5437c33067)
Visual Studio extension to enable development for Xamarin.iOS
Comment 1 Jon Goldberger [MSFT] 2014-05-29 14:47:08 UTC
Addendum for clarification: The image _does_ show in iOS designer after step 2 above when using the windows style path, i.e. Images\image.jpg
Comment 2 Mohit Kheterpal 2014-06-02 12:03:42 UTC
I have checked this issue and getting same behavior after following steps mention in bug description.

When we Debug application on device then Image disappear from designer and application launch with added Image successfully on device or emulator.
Comment 3 F Masolijn 2014-06-12 03:36:30 UTC
I'm getting this same bug.

2014-06-12 09:32:48.140 SingleViewTest[12451:a07] Could not load the "Images\bg_splash_medium.png" image referenced from a nib in the bundle with identifier "com.your-company.SingleViewTest"
2014-06-12 09:32:48.143 SingleViewTest[12451:a07] Could not load the "Images\booklet_dashboard.png" image referenced from a nib in the bundle with identifier "com.your-company.SingleViewTest"

Note the \ in the path of the image that iOS is trying to load. This is the path I've selected in VS on Windows, but iOS Designer needs to translate that to a / before deployment.

When checking the XML the row below shows that it indeed isn't translating between path-separators correctly.

<imageView userInteractionEnabled="NO" contentMode="scaleToFill" id="20" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" image="Images\bg_splash_medium.png">
Comment 4 Alan McGovern 2014-09-15 07:48:31 UTC
This is an iOS Addin issue, not a designer issue. It looks like the files were mistakenly not copied to the final app bundle.
Comment 5 Alan McGovern 2014-09-15 07:49:17 UTC
Oh, on second thoughts maybe this is a designer bug. The file paths could've been incorrectly written to the storyboard.
Comment 7 Alan McGovern 2014-09-30 11:25:26 UTC
Fixed in master: https://github.com/xamarin/md-addins/commit/70b488b984b09896751ba2d971a0294bd691a7ac

monodevelop-5.5-branch will be backported once the patch is tested in windows.
Comment 8 Alan McGovern 2014-09-30 12:33:54 UTC
Backported to monodevelop-5.5-branch with commit https://github.com/xamarin/md-addins/commit/bcebe330d7d264c5241c3d9b459aaf3bfd8ac4e0