Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Meaning of the middle line on xcode asset slicing?

Official documentaion:

https://help.apple.com/xcode/mac/8.0/#/deve65bd8d0d

3 vertical lines: - left line shows the left unstretchable area - right line shows the right unstretchable area But can't understand what does the middle vertical line actually do. Could you explain how does it work?

like image 742
Vyachaslav Gerchicov Avatar asked Jan 10 '18 13:01

Vyachaslav Gerchicov


People also ask

What is an asset catalog?

An asset catalog is a type of file used to organize and manage different assets and image resolutions used by your app's user interface.


1 Answers

But can't understand what does the middle vertical line actually do. Could you explain how does it work?

The middle line controls the width of the resizable part of the image. When you're done with vertical slicing, you end up with three parts: the left part, the right part, and a center part that will be stretched (or tiled) to let the image fill whatever space you need. The center part is the area between the left and middle lines. Notice that the area between the middle and right lines is shaded, indicating that that part of your original image will be removed from the sliced asset.

Note that you can also slice horizontally or horizontally and vertically. If you slice in both directions, you end up with what's known as a nine patch image, where there are unstretchable parts for the four corners, horizontally stretchable parts for the top and bottom edges, vertically stretchable parts for the left and right edges, and a vertically and horizontally stretchable center section.

like image 67
Caleb Avatar answered Dec 23 '22 07:12

Caleb