Images not displaying from Assets - ios

I have a xamarin.ios (Using VS mac) project that I'm trying to add images to. I have 5 images and only two of the are loading. I have followed https://learn.microsoft.com/en-us/xamarin/ios/app-fundamentals/images-icons/displaying-an-image?tabs=macos for uploading images. It's weird cause the two images that are loading don't show up in the Assets folder when I open it up in Xcode but they do appear in finder. I'm not sure why I cant get the other three to appear..
"Coke" and "blt" are the only ones that show in the app, but they don't appear in the Assets in xcode.
I've made sure spelling and extension usage is all correct.
Any help would be great.

Related

Images with #1x #2x suffix do not appear in app

I am struggling with an issue in an app with a couple of custom images in the navigation bar. This was all working perfectly well until yesterday, when the images stopped appearing in the navigation bar.
There is a clue that, when I add one of the images to a view controller via the xib editor, I get a warning message e.g. Could not load the "back-arrow.png" image referenced from a nib in the bundle with identifier "com.test.myapp"
What does work is renaming the files from e.g. back-arrow#2x.png to back-arrow.png - but then its displayed at the wrong size. I managed to get one of the images working and displaying correctly yesterday, but in trying to get another image to display it has disappeared again.
I have checked the files are present in Copy Bundle Resources. They appear in the Xcode image browser.
EDIT:
When I delete the #1x images, the icons appear again. What might be going on here?
Using Xcode 8.1, testing both in simulator (iOS 10) and iPad 2 (iOS 9).
The images were not in the .xcassets folder, just added as Resources. I did it the proper way and made each image into an Imageset, and it now works as intended.

image is not rendered though its shown in the storyboard

So I'm working on Xamarin studio 6.1.1 and am building a native Xamarin.iOS app, on the LaunchScreen.storyboard file I have two UIImageViews, assigned image for each one from image assets.
the problem is when I run my app one of the two images is shown and another one is not though both are shown in the storyboard file.
I have placed all my images directly in the Resource folder and made sure that there is nothing missing, The scenario is soo simple and I'm not sure what the reason behind this.

Launch Image not showing up in iOS application (using Images.xcassets)

I'm having some trouble getting my launch image to show up in my application.
I have created all the static image files in the Images.xcassets file in an asset set called "LaunchImage".
I noticed that my project also contains a LaunchScreen.xib file (which was automatically created by Xcode).
This .xib file appears when I run the application on my iPhone6 device. It doesn't appear in the simulator for iPhone4s (which makes sense, since xib launch screen is only for iOS 8 +).
I want to use the static images that I have created since they fall under the Apple Guidelines and go with my application. However, I haven't had any luck at getting it to show up.
I noticed under the project settings that there is a section called App Icons and Launch Images. I see how the .xib is connected by the Launch Screen File option I assume.
However, there is an option called Launch Image Sources. What does this do?
I found this: http://matthewpalmer.net/blog/2014/09/10/iphone-6-plus-launch-image-adaptive-mode/. However, it didn't explain anything about the Launch Image Source option.
There is a button next to the Launch Image Sources called "Use Asset Catalog". When I click it, it just says Migrate Launch Images to an asset catalog. Your existing launch images will be copied into a new image set. Choose an asset catalog to use: .
This is confusing to me because I've already created my asset catalog and I definitely don't want it to overwrite images.xcassets file. So, how do I link this to the Launch Images Asset Set that I already have created? Also what "existing launch images" is it referring to will be copied into a new image set?
Thank you!
UPDATE 1
So, I tried the migrate images option and chose to the new set option. This caused a new image set to be created which I deleted. However, the name left in the Launch Image Source was set to LaunchImage which somehow connected to the image set that contains my launch images. It did mess up my LaunchImage set -- the images were set to unassigned. I deleted them and dragged my files to the appropriate box in the LaunchImage asset set. However, when I run the application it still doesn't work. =( Launch Image doesn't show up.
I even removed the information that was in Launch Screen File (which my assumption was the setting that connects to the .xib file). Still, somehow the .xib file appears on my iPhone6 device. =(
Any ideas what's going on?
I had this problem. I tested on simulator. I left the "Launch screen file" blank and removed the line about the "launch screen file" inside the plist. I restarted Xcode. Nothing. In my case in was not black it was white. Xcode 7 target ios 9.
i read this one as well: Launch Image does not show up in my iOS App
The launch image only showed up when i deleted the app from the simulator and run the app again.
I finally figured it out!
So, in your project settings, go to the section that says: App Icons and Launch Images
Remove the information found in Launch Screen File if you do not want to use .xib file.
Then, in Launch Image Source, Choose to migrate and if you have already created your LaunchImage file and added the images to it. Then click the asset catalog that shows up. The name of the one that contains your Launch Images.
This will create a new Launch-Image2 in your image set. To use the one you already have created, click the drop-down menu next to Launch Image Source. And you should see your other Launch Image set. Choose it. Then re-build your application and run it. You should see your Launch Image. =)
Hope this helps!
Note: it won't delete your images that you already have in the asset catalog. It will just create a new LaunchImage asset set.
Reference: https://developer.apple.com/library/ios/recipes/xcode_help-image_catalog-1.0/chapters/StoringAppIconsandLaunchImagesinanAssetCatalog.html
This is too important !
should be empty ! Launch Screen File
Working solution. Saved my time and hope it will save yours as well.
Make sure your images are accurate size according to Apple Guidelines.
Make sure, You will select only one option , either launch screen file or Launch Image Source. You can find these two options in Project build settings -> General
Clean and build.
Recommended solution step by step:
Create splash image assets (name as LaunchImage) there in
Image.assests folder.
Select LaunchImage asset in Launch Image Source option.
And Clear the text in Launch screen File option.
Clean and build.
Below is the reference image for right configuration:
I had this problem in XCode 9.4.1, turned out to be caused by the assets folder not being included in the Bundle Resources.
Select the project, then your target. Go to 'Build Phases' and open up 'Copy Bundle Resources'. If the .xcassets group you want to use isn't listed then just drag it in from the file browser.
Worked for me...
After few hours of unclear answers:
1) go to setting app General section in xCode.
2) Scroll down to App Icons and Launch Images.
3) Clear Launch Screen File (just leave it blank)
4) Set Launch Images Source to LaunchImage (remember to create them in Assets.xcassets)
Now app will use images You set in LaunchImage.
Had a similar issue today. Tried to let xCode create automatically the Asset, but it was always unassigned.
The solution was to create manually the Launch Image in the ImageAsset and assign the files for his respective resolution.
It looks like xCode created a different type of Launch Image asset, so it didn't
recognized the asset (v8.3.2)
Solved! I've tried a lot. The problem was that the launch image shows in simulator and didn't show in real device. I got a Storyboard with UIImageView in it. Strange was that old images worked, and images, that i did add recently not. First i thought that this is a problem with assets. No. Than i checked color profiles and did a lot of tries with different profiles: left-working image, right-not working. Didn't help.
Then i started google and found this thread
Main solutions from here:
1) Didn't helped for me.
Change image property of my launch image using Preview app: [ Tools
--> Assign Profile... --> ColorSync Profile: <> ]
2) Helped
Even deleting the app and re-installing from XCode doesn't work.
However, changing the bundle ID does work. With no other changes, the
existing bundle ID shows no images, but the new bundle ID shows them
all correctly. I'm doing that as a temporary work-around, since a
previous post in this thread suggests that installing the builds via
TestFlight doesn't encounter the problem.
3)
I did three things (the first two on their own didn't do it, but may have assisted the third which did work)
1) Copied all of the images to the root directory (same location as
xcode puts the images)
2) Created a folder in Images.xcassets and put the images in there.
3) The images in the launchScreen.xib were originally called
imageName.png. This was changed to just imageName (remove the file
extension.
After the third thing the images appeared. I don't know if either of
the first two steps are required, but hopefully it will help someone.
4) Helps but old and rude
Taking the images out of the asset catalog fixed the problem for me.
I just added the #1x, #2x, and #3x image used on my launch screen to
the project the old way and it seems to be working fine. Trying to
confirm it through TestFlight now, but iTunes Connect isn't behaving
at the moment.
I thought this is an iPhone cash problem. So you don't need to warn about it thus the image will show when installing with testFlight. After this conclusion i did next and that worked:
1) Uninstall app
2) Reboot phone
3) Build app to the phone
I just figured this out. My launch image was not showing up, I get a white screen when launching on a device (iPhone 6, 7+) or testFlight. Fix: Renamed "Landing_screen.png" to just "Landing_screen" removing .png part. https://stackoverflow.com/a/43592662/3445278
Close the simulator & open it again worked for me
I have face same issue.
In splash screen image is not displaying but other thing like label and view are showing up correctly .
To fix issue first verify all of the above settings in your code. If nothing works then Restart the iPhone solves my problem.
Hope it is helpful to someone here (Happy to help) :)
I've just spent a little while on the same problem, but found the answer, and put it into a Youtube Tutorial
Create your ArtWork Image. 1024x1024 that conforms to Apple's requirements for Appicons and LaunchImages
Set up a folder to hold your newly created Assets.xcassets
Open Asset Creator Pro and drag your new image into it.
Do your app icons first, putting the created file into your new folder.
Using the SAME image, select LaunchImages next, and "Append" the created set into the new, existing Assets.xcassets
Open your XCode project, and delete the eisting - probably empty - Assets.xcassets folder. If you have other files in it, then just
delete the Appicons and Launchimages sets.
Drag your newly created Assets into the XCode project, making sure you set the option to Copy the files. Sometimes this can be off!
beware.
check what's in the cassets, you should see your new images.
Make sure the line Launch Screen File in your Project settings is BLANK.
Make sure your LaunchScreen storyboard is BLANK. Anything in there and the images wont load.
test it.
Watch the video.
should be empty ! Launch Screen File
it worked for me
Its working fine for set Launch Image:
Go to setting app General section in xCode.
Scroll down to App Icons and Launch Images.
Check Launch Screen File in settings page
Set Launch Images Source to LaunchImage as storyboard file(Set image in Launch screen) (or) You create a own launch image Xib file.
Note:
Now app will use images You set in LaunchImage.
Close the simulator & open it again worked for me
Clean Build Folder
Close your xcode and reopen it
Adjust constrain for the UIImageview
Check Launch Screen File in settings page

where did the icons/launch image table go in xcode 6?

If you look at this thread
iOS 7 App Icons, Launch images And Naming Convention While Keeping iOS 6 Icons
You see that xcode used to show a nice table where you could see all icon/launch image dimensions, what is missing etc.
I just managed to start migrating our app to ios8/iphone6 so i also upgraded xcode. However, now i can't seem to locate that table anymore, all there is is an empty section with buttons to "use asset catalog":
So, i have 2 questions:
is the table somewhere else, or is "asset catalog" the way to go now?
I tried the asset catalog, and all images are copied into this xcassets catalog. Is there any reason for me to keep the original files in the project? Do i need it for anything else, like ios5? I looked around but found no answer.
Thankful for some pointers.
Use the Asset catalog , this is the preferred way now.
If you use the asset catalog, all the images will be copied to images.xcassets, there is no need to keep the original files. If you control click the assets and show in finder, you could find the copied images. In asset catalog you have options to give different images for iOS 5,6,7 landscpae or portrait whatever is appropriate for your app.

Xcode not finding images from atlas folders when running

I have an app created in Xcode which has loads of images. To make it slimmer i created folders within Xcode as .atlas and made sure that these contained the (*.png) images i wanted.
from the storyboard and XCode navigator i can see the png files, and the UIImageView objects show the correct image selected from the dropdown.
so there is no problem with the images being accessed, and no issue with file name.
When i clean/build/run the app through the iPhone simulator no images show the outcome is blank...
There are a bunch of different reasons why this could be the case.
Here are a lot of answers that worked for some.
http://solvedstack.com/questions/could-not-load-the-image-referenced-from-a-nib-in-the-bundle-running-on-device
In my case i had the same setup you described.
One Texture Atlas and i wanted to use some of the pictures in there in an UIImageView.
I assume since TextureAtlas is mostly meant for SpriteKit, i added my Pictures that i wanted to use to the Images.xcassets folder.
Then the preview in the Storyboard works as well as on the device.

Resources