Image not showing up in iOS simulator - xcode

I am currently working on an app in Xcode. I'm having the following problem:
I have created a 60-60 pixel image in Adobe Photoshop with a transparant background. I saved this as an .png file, and added it to the 'Supporting Files' section of Xcode. I created an image view in my Main.storyboard. However, when I run the iOS Simulator, the image doesn't appear. I have tried the same thing with a different .png file that wasn't made with Adobe Photoshop, and this image did appear in the iOS Simulator, so the problem clearly has to do with the image and not with the positioning or coding.
Thanks in advance!

Related

Xamarin.iOS: Adding image in visual studio assets.xcassets imageset for both landscape and portrait orienatation

For my Xamarin.iOS project I am using LaunchScreen.Storynboard for showing launch screen. For adding images, I am using asset catalog. My application supports both orientations on iPad. However, when I open imageset in visual studio it shows only one #2x image for iPad which will be occupied by Portrait image. Now, for adding landscape image I have edited its Contents.Json file and added image details there. added image locally and also added its entry in projects .csproject file.
However, when I build and run application its only picking one image and applying it to both the orientations.
e.g. Its picking landscape image and applying it in both landscape and portrait launch screen image. Now, in portrait mode image is showing vertically stretched.
which is causing UI issue.
How to set image for both the orientations in visual studio xcassets imageset?
Any suggestion would be appreciated.
Thank You.
How to set image for both the orientations in visual studio xcassets
imageset?
LaunchImage ImageSet is the old way which has been deprecated, we don't need to set storyboard or xib on Launch Screen, but it is nothing except image. We can't find a way to set LaunchImage ImageSet in the latest Visual-Studio.
Refer: Xcode 11 UILaunchImages has been deprecated, use launch storyboards instead Warning
Now, in portrait mode image is showing vertically stretched. which is
causing UI issue.
You should use auto-layout to layout your image in both landscape and portrait orientation so that it won't be stretched. See document here: Managing Launch Screens with Storyboards
:

Xcode 10 UIBarButtonItem Images Vanish On Storyboard

I am using the latest version of Xcode 10 that's available in the app store. I keep losing UIBarButtonItem images in the designer. They are visible when the app is run. I can get the images back by switching the image to a different one and then switching it back again. This is what it looks like when the images are gone:
This is what it looks like when the images are visible:
If I change one image, all of the images on the screen come back. They will generally stay until I close down and reopen the app in Xcode.
They always display correctly when run on an actual device. I have tried it on multiple iPads, an iPhone, and every device simulator that I could find. This is only an issue with images on the designer.
This is how the images are set up in Xcode:
The 1X image is 24x24, the 2X image is 48x48, and the 3X image is 72x72. All images that I am using were created in Affinity Designer. They were all saved as PNG files. This is a file with the images that I'm using for the checkmark: Checkmark Files
All of the images have the following settings:
This is what the settings for the UIBarButtonItem looks like.
So far, this is just an annoyance that is happening in multiple apps that I'm working on. I'd just like to figure out why it is happening and if it is just an Xcode bug.

iOS XCode launch screen storyboard does not display image from asset catalog when running on device

I'm running into an issue where an iOS app project using Launch Storyboard does not display some images from the asset catalog. But it can display another image in the same image view. This tells me that the image view is set up correctly, and something is wrong with the image itself
How can I understand why my image is not displayed on launch screen when starting app?
I checked the asset catalog membership, and the images are members of the correct target. The image displays in the interface builder preview.
I checked and images are not displayed when saved in either JPG or PNG format.
The image previews fine on Storyboard preview.
I tried using smaller image, so it doesn't seem to be a file size issue.
Does not work on either device or simulator.
This image displays:
This image does not display:

Why does macOS Finder draw areas of my app icon where alpha != 1 in black?

When I select my app in Finder using the columns display, the app icon displayed in the rightmost pane has all areas where alpha != 1 rendered in black.
Screenshot showing alpha!=1 areas in black
However you can see the the icon in the middle pane is rendered correctly. Also if I view the app's .icns file in Finder it is rendered correctly:
screen shot of app's .icns file
The icon is also rendered correctly in the Dock and in Launchpad.
Why does Finder render black in this one case?
macOS Sierra 10.12.5 but I doubt the issue is specific to this version.
I have spent almost a day hunting for solutions on the net but have not found anything even remotely close to this problem. No other app exhibits this issue. I have also tried to find an application that will let me view the details of each image of a working application's .icns file. Again without success.
Make a new .icns file using Image2Icon instead of Axialis IconWorkshop.
Following I'L'I's suggestion I examined the icon file with Preview. Preview shows that the 512x512 & 72x72 sizes do not have an alpha channel and have a black background where alpha != 1 in the 1024x1024 and other images that do have alpha. There are other strange images, including gray scale.
The .icns file was created for me by the icon designer using Axialis IconWorkshop. I do not have this software so do not know if the strangeness is cockpit error or application bugs.
I made a new .icns file from the same input PNG file using Image2Icon. In this file, all sizes have alpha and there are no strange images. Using this file, the display in Finder is correct.

Xcode Ipad Simulator Background Image Stretched

Whenever I run my app through any of the Ipad simulators in xcode, the background image is stretched or zoomed in and looks really abnormal. When I run the simulator for the Iphones the background image is fine. Does anybody know what might be causing this?
edit:
Please see the following screenshots of the launchimage (how it should look) and the background once the app is done loading.
My launchimage and how the background should look:
How the background looks once the app is done loading. Notice it is zoomed in:
I've noticed your original image has resolution of 2048x1536, which is Retina display's resolution.
Solution: Rename it adding a suffix of #2x (e.g.: if your image's called background.png, rename it to background#2x.png).

Resources