Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

alinpha

macrumors newbie
Original poster
Aug 10, 2016
12
0
Hey,

I have developed an app that uses a lot of sliced images for it's UI.
Since the Mojave release my app looks horrible because the images displayed not as they should, and i do not have any other way to bypass the problem. I have to use the images as 9 patches.

The thing is, that no one ever talked about this problem, or i just can't find any info about it anywhere, and i'm starting to think that the problem is on my MacBook solo.

I just want to ask, if someone who runs Mojave on their developer machine can help me by reproducing a few steps below:

1. create a new macOS project in Xcode.
2. put a small image in the assets folder and slice it anyhow.
3. create a big NSImageView in the IB, assign it the sliced image, make it's scaling - axes independently, border type - none.

After those steps, i need someone just to confirm he has the same problem as i do - Xcode IB displays the image as it wasn't sliced - just a stretched pixelated image, and after you run the app, the image displayed as sliced, but with wrong resolution.

Many thanks in advance!
 

Senor Cuete

macrumors 6502
Nov 9, 2011
430
31
The NSImageView scales the image from your.xib file into the destination rectangle. This will distort the image as needed to make it fit.
 

alinpha

macrumors newbie
Original poster
Aug 10, 2016
12
0
Senor Cuete,

I've already tried all the possible ways of adding an image, including loading it via xib.
I just wanted someone to confirm that the problem exists not only on my machine.
The important thing is that the problem occurs only at macOS projects and only with sliced images (9 patch).
 

Senor Cuete

macrumors 6502
Nov 9, 2011
430
31
I'm just wondering exactly what a "sliced image" is.

Does this occur with images that aren't "sliced"?

Also you seem to be describing drawing a very small image into a big image view. This could be a problem due to scaling.
 

alinpha

macrumors newbie
Original poster
Aug 10, 2016
12
0
You can create 9 patched images in the assets catalog, that can be a very small image and after you use slicing it will stretch or repeat itself at the areas you mark.
Another way of doing this programmatically is to set the NSImage capsInset.
The problem doesn't exists at non sliced images.
 

alinpha

macrumors newbie
Original poster
Aug 10, 2016
12
0
I did.
I created this thread to ask if someone could reproduce the problem.
Seems like nobody using sliced images except me)
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.