Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

iOS9: Tiled images from asset catalog are repeating edge pixels (Xcode, Objective C)

Here's a fun one: in iOS8, repeating an image was as simple as using 0px edge insets and setting the center to "Tiles." On iOS9 however, the images do not tile. Instead, the blank space copies the edge pixel forever - and not from the sides I would expect:

Incorrectly tiled:

Perhaps I'm doing this wrong? Is there a better way to achieve a tiled background?

Incorrectly tiled:

like image 445
Ben Ritter Avatar asked Dec 03 '25 09:12

Ben Ritter


1 Answers

I found a workaround. For some reason, if you only slice the image horizontally, the image tiles correctly. I DO NOT recommend this to anyone here looking for a quick fix, as I do not know how this affects previous versions of iOS. Or why it even works in the first place. If anyone can provide a better answer, I'll accept it instead.

enter image description here

like image 155
Ben Ritter Avatar answered Dec 05 '25 02:12

Ben Ritter