You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Difference in jpg resource syntax on iOS/Android #1788
In order to use a .jpg file that lives in App_Resources on iOS I must use res://my_file.jpg, whereas on Android I need to use res://my_file (no extension). This forces me to needlessly fork my code to use an image with the same name.
Our current Deployment Target for {N} iOS projects is 7.0. In theory we can add some additional code to try to load the same image with extension if imageNamed returns null - do you think we should do this?
Thanks a lot for tracking this down @enchev & @tzraikov. This is an interesting one. At the end of the day what’s most important to me is that I can use the same syntax for both iOS and Android. So I’m fine using either res://my-image or res://my-image.jpg as long as that loads my-image.jpg on both platforms.
I think your pull request makes a lot of sense, assuming there’s no performance hit... which, I assume there wouldn’t be because you should never hit that check when you’re dealing with .png files.
Activity
enchev commentedon Mar 24, 2016
Hey @tjvantoll,
Thanks to @tzraikov we've found what's going on. You can find here more info:
https://developer.apple.com/library/ios/documentation/UIKit/Reference/UIImage_Class/index.html#//apple_ref/doc/uid/TP40006890-CH3-SW10
Our current Deployment Target for {N} iOS projects is 7.0. In theory we can add some additional code to try to load the same image with extension if
imageNamedreturnsnull- do you think we should do this?[UPDATE] I've made pull request.
tjvantoll commentedon Mar 24, 2016
Thanks a lot for tracking this down @enchev & @tzraikov. This is an interesting one. At the end of the day what’s most important to me is that I can use the same syntax for both iOS and Android. So I’m fine using either
res://my-imageorres://my-image.jpgas long as that loadsmy-image.jpgon both platforms.I think your pull request makes a lot of sense, assuming there’s no performance hit... which, I assume there wouldn’t be because you should never hit that check when you’re dealing with
.pngfiles.Update ui-tests-app
lock commentedon Aug 28, 2019
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.