Repeat image horizontally and vertically

前端 未结 5 1405
刺人心
刺人心 2020-12-05 05:29

I want to repeat the following image:

\"enter

to achieve the following backgro

5条回答
  •  抹茶落季
    2020-12-05 06:08

    I found solution in images.xcassets,

    Step 1:- Put your image to images.xcassets

    Step 2:- Click on image, then click on bottom right corner written “Show Slicing” Put image

    Step 3:- Click on Start Slicing
    start slicing

    Step 4:- Click on "Slice Horizontally and Vertically" button
    Slice horizontally and vertically

    Step 5:- Here you will see 3-Horizontal and 3-Vertical slice lines.
    enter image description here

    • Put the most left vertical line to left side of image and both right most lines to right side of image.
    • Put the most top line to top of image and both bottom most lines to bottom of image.
    • So the final result will be looking like this.

    enter image description here

    Step 6:- Use this image.

    And now image will be repeated.

    enter image description here

    Note:- If you give slicing to 2x image it will repeat just 2x image, for 3x images you need to do the same slicing.

    Example by Apple

提交回复
热议问题