Custom Graphic Background

Hi everyone,

i’ve a question about custom graphics. I would create an image for background of my view. the size of this image what is it?

i know that there is this size factors but there is different size of display.
Here find all size

if I want create in photoshop an image to use like background what size of Rendered Pixels I have to do it? every size and marked with @2x and @3x factor?

or i have to do only 3 image e mark it with @2x and @3x factor?

Thanks

You just create the right sized image for the devices you will cover and drag them into xcode into the assets folder and xcode will guide you.

It’s not as easy as it used to be but it still isn’t hard. First, I want to recommend Sketch - it lets you export regular, @2x and @3x images all at once from your artboards. The artboards you define can cover all of the device sizes that you want to specifically address so it makes things much easier.

Generally if I am making images (and I’m a programmer, not an artist!) I start with the highest resolution, which would be the 3x, and then I resize to get the other resolutions. Usually the resample works fine - most actual artists probably would not do this because they would notice the resample artefacts and want to correct them.

@aeberbach thank you for your answer. but the problem is this. if I had only 3 graphics (@1x, @2x and @3x) i’ve no problem. I insert the three graphics (for example of a button) into the asset folder and it’s done. but about the background (i’ve sad ‘background’, not launchscreen’), i’ve not three graphics. how show the site that i had linked in the previous thread, because there are different device with different sizes i need more graphics, almost one for each device. but this meaning that in the code i’ve to check the device and set up the right image? or there is a better way?

in few words

How many graphics I need to create for all iOS devices background?

OK, well that’s harder I agree. If you are working with graphic designer and you have a background that cannot be resized in code you probably need to catalog all of the image sizes you require, then have your designer prepare an image for each of those sizes. That’s a lot of work of course.

But planning can help you avoid some of the work. If you can separate out some elements in the background and position them on a generated background (i.e. flat colour, gradient etc.) then you can often get away with just two or three widths of those design elements and you just need to be clever in how you position them.

@aeberbach thank you very much for your answer. it’ clear and well explained. now i’ve understood how to solve the problem. but, fortunately I noticed that the background that I wanted to use is a pattern. then i’ve save the image as pdf, inserted in the assets of project and set it as a Single Vector. and it’s working well.

but now i’ve an other problem. i’m trying to set the background image of all navigation controller of my app.

for do that i’m using the appearance method. but I don’t know why the app crash, Xcode gets angry and give me this answer:*** Terminating app due to uncaught exception ‘NSInternalInconsistencyException’, reason: ‘Only RGBA or White color spaces are supported in this situation.’

WHAT??? this image also is in PDF but is in RGB like other images. furthermore this happen only when you use the appearance method. if you set the background normally, without the appearance method, nothing is happening and the image is loaded and set it. the problem is the file? is because the file is an PDF?

how can I fix this problem? can I use appearance with PDF image? o I have to create 3 png image for also these components?

thank you very much

I really think you have to use RGBA here - the reason is probably related to being able to blend the background with overlapping UI elements (since UI translucence became a big thing with iOS 7).