Does iOS background image repeat on iPad?

I have an image with 1x, 2x and 3x types with resolutions of 404 * 750, 808 * 1500 and 1212 * 2250 respectively.

Here is my code:

self.view.backgroundColor = [UIColor colorWithPatternImage:[UIImage imageNamed:@"bgr"]];

On my iPhone, the background does not repeat and its good. but the iPad background is repeated 4 times.

Do you know why this is happening?

+4
source share
2 answers

From Apple Link

You can use the colors of the patterns to set the fill or stroke colors just as you would a solid color. During drawing, the image in the color of the drawing, as necessary, to cover a given area.

, iphone , ... ipad , ... .

image.xcassets iphone iPad...

.

enter image description here

iPad , .

+5

iOS , .

1x: my_image.png
2x: my_image@2x.png
3x: my_image@3x.png
1x iPad: my_image~ipad.png
2x iPad: my_image~ipad@2x.png
+2

All Articles