There exists a number of questions (some answered already) that pertain to the launch images. I had no problems using launch images per se. My problem comes when trying to support multiple orientations of the launch image (portrait or landscape for my app).
The problem is this:
When i started my app dev, i used the usual default.png as the launch image.
But now i have 4 different launch images (portrait and landscape, plus their retina versions). However, with these launch imaged named different, Im seeing a black screen for the launch, no matter what orientation the device is in.
I spent a day on this. And i decided to just go with a single default.png (retina portrait) since I realized the launch image only lasts a few seconds and is not very important any way.
Alas, the curiosity is killing me.
Note: the images were named as follows (notice they are lower cased, and they also are placed under /images folder rather than at the project root folder):
default-portrait.png
default-portrait#2x.png
default-landscape.png
default-landscape#2x.png
Question:
what am i doing wrong? like i said, i went thru many online references to this problem. none of them helped for me.
It's because you put them into a sub-folder.
This document states:
All launch images must be PNG files and must reside in the top level
of your app’s bundle directory.
The fact that you are using lowercase filenames looks a bit dodgy too...
Related
We have number of images used as app assets, for case of simplicity, let's say 10 images only.
As far as I understand, Xamarin.Forms will not cashe these images, so if I have these 10 images showing in my toolbar (this is just to explain issue, we would not really put 10 images in a tiny toolbar) and I have 5 pages showing same toolbar, that means the 10 images will be loaded each 5 times resulting in total 50 images loaded. I would like to load only 10 images rather than loading 5pages x 10images = 50 images.
In addition, if I have to add these 10 images in our repository, I would have to add at least 3 copies of same image to our repository (1 for Android, 1 for IOS, 1 for UWP). This results in 30 images in repository but in reality I needed only 10.
So, these 2 issues make be believe there should be a better cross-platform solution so I can share same image across all 3 platforms, have only one image used by all 3 platforms (Android, IOS, UWP), and I load an image only once in memory regardless how many times I show in the UI.
You can look into FFImageLoading which supports caching. To have images in your shared code instead of your platform-specific code you could look into embedded images:
Embedded images are also shipped with an application (like local images) but instead of having a copy of the image in each application's file structure the image file is embedded in the assembly as a resource. This method of distributing images is particularly suited to creating components, as the image is bundled with the code.
https://developer.xamarin.com/guides/xamarin-forms/user-interface/images/#Embedded_Images
Keep in mind though that adding images per platform isn't a bad thing. Each platform has its own image versions due to different pixel densities etc. so to make it look good on each platform you might want to consider the platform-specific route.
Another alternative is adding your images as file-linked images in each platform specific file. The image file itself can saved in a single location and file-linked into the correct directories per platform.
There is a library for Xamarin.Forms called Forms9Patch which supports different resolutions and devices just like the specific projects for Android / iOS.
Forms9Patch has a MIT-license, here's the github.
Also this is a video that should give a good general overview.
I have a Mac desktop application developed using Xamarin.Mac and XCode. The application is loading views that should have a considerable amount of content as blank/white screens for a select few end users. While I've not been able to reproduce the issue locally and it doesn't appear to be impacting many people, it does happen consistently for a handful of users(6 out of over 4,000 at the moment). The app works just fine for the vast majority and uses a main window controller that sets the content view as needed by calling the applicable ViewController. When the views in question are loaded for the given users, it renders as a blank white area.
I did notice however that at least some of the objects in the views are actually there, just not visible. For instance, one view has buttons that are still "there" as you can click on them if you know where they are supposed to be positioned(and they also fire correctly) but they are not actually visible as the area is all white with no visible content. It's as if everything is loading properly but the UI just isn't cooperating in displaying objects that are actually there. The closest thing I could find was this Diagnosing run loop issue (partially frozen UI) in Cocoa application
However I'm not sure it's the same problem and there was no resolution for that either. Has anyone else ever encountered something like this?
Ok, got some new info. After doing a remote session with a user we had no luck with the hardware and the console didn't provide much insight, however we did stumble across a workaround that fixes the issue and may give some clues as to the real problem.
When the application is initially installed, we prompt the user to ask if they want it moved to the default Applications directory. They do not have to move it as it will work the same from pretty much anywhere but we do this for convenience. For the users having this problem, we noticed that they all had the app installed in the Applications folder. By sheer luck, one user accidentally chose to not move the app after reinstalling it per our support team. When the app was installed in his default Downloads directory, the problem vanished and the app worked as expected.
After testing various other directory locations(Downloads, Documents, etc.) we found that the issue only seemed to exist if the app was installed in the Applications directory. Furthermore, if the app was installed in the Applications directory, we could simply move it or copy/paste it to another directory outside Applications and when launching it from that new location the issue was resolved.
Seems like there is something specific to the default Applications directory that is causing this to happen(as odd as that sounds). Keep in mind that even when the app is installed in the Applications directory, this issue only happens to 7 people out of over 4,000.
Any ideas as to what might be special about that directory that could explain what we're seeing?
There is a way to change de launch screen without have to change each image one by one?
Like the doc says I used the tool: http://nsimage.brosteins.com/ to change the icon, but to change the splash screen I have to change 20 images, there isn't an easiest way?
The easiest way to do this; is on the community site...
http://nativescript.rocks
Actually the images sub-site specifically.
http://images.nativescript.rocks
It will allow you to post a single image and it will generate all the proper size screens for both android and ios.
The second way to do it is to use the ns command line (tns was renamed to ns in late 2020)
ns resources generate splashes ../SourceImage.png --background "#FFFFFF"
You want to use a source image of at least 1024x1024 as Apple requires this for the main app page image, otherwise you will be missing this size and you won't be able to submit the app to Apple.
Please note: no matter which way you generate your screens; you should always DE-INSTALL the app from your test devices so that it can do a full reinstall so that you do see the new splash screens.
Disclosure:
I'm the developer of http://nativescript.rocks group of sites.
With NativeScript 4.x.x and above the CLI has introudced a command for automatic generation of splash screen for both iOS and Android.
tns resources generate splashes ../myImage.png --background "#FF00FF"
The above will take the myImage.png and create different scaled images and replace them in `splash_screen.xml. It will also produce a background PNG with the desired background color. More about this feature in the official documentation.
I drag pdf intro image assets (universal) and building Xcode.
There is no generated png#2 png#3 . (only Pdf)
I follow this tutorial :
https://icons8.com/articles/how-to-use-vectors-in-xcode-7/
When I start app on the device images are so bad quality...
Xcode 6, 7 working ....
Maybe PDF file needs optimisation ?!
In research I found "size of svg is not important" but in this case it is (I test it).
Not sure if this helps, but from what I was reading about this, Xcode doesn't fully support vector graphics. It sounds like instead of you being able to load a vector image (.pdf) and it scales however necessary. Instead, whatever the default size of your .pdf is, it'll assume that is the 1x size, then scale the pdf to automatically create the 2x and 3x image when it's built. So its not actually scaling the original, just creating a 1x, 2x, and 3x png of the original size of your pdf. From what I'm reading, people are thinking this is done to maintain backwards compatibility. I couldn't find anything that says it has changed in Xcode 8, so I'm assuming it still works the same way.
This question seems to answer it well: How do vector images work in Xcode (i.e. pdf files)?
Hope I was able to help.
Possible hepful support links, I would suggest updating to the latest. xcode 13
xcode 8.1
xcode 8
I have an .iconset which can be found here. Building a binary with Xcode results in an icon that looks like
Generating a .icns file directly using iconutil results in the same thing. Everything but the full resolution asset look weirdly chopped up on retina screens, but displays fine on non-retina screens. Converting the generated .icns back to an .iconset gives me the chopped up assets instead of the original assets.
Anyone have any idea as to what might be going wrong here?
I figured it out, though I'm not exactly sure what caused it.
I generated the app icon using Gimp. I believe when I first generated the icon I created a 1024x1024 icon and then scaled it down using Preview. I just regenerated all of the assets by scaling and exporting all through Gimp. Now the assets look fine. Presumably some information was lost in Preview's scaling.
I believe you need to put them in an Asset Catalog to get all the resolutions to show up correctly. If you don't migrate them into one you can manually edit your applications .plist file, although there shouldn't be any compelling reason you would need to go that route.
Reference: Mac Developer Library: Asset Catalog Help
Select Targets > Your App > General > App Icons