Xcode设置图片拉伸区域
2017-10-14 本文已影响0人
huhuhuhu123
没有设置拉伸区域之前图片是介个样子的~
![](https://img.haomeiwen.com/i5229369/bf1af716d0d21c2e.png)
开始设置拉伸区域:
1.在Assets.xcassets中找到你要设置的图片
![](https://img.haomeiwen.com/i5229369/8c8cb2125b8e13c9.png)
2.选中图片,在右侧找到Slicing属性
![](https://img.haomeiwen.com/i5229369/e798390c1fedd1c8.png)
Horizontal :水平拉伸
Vertical:拉伸
Horizontal and Vertical:水平和垂直拉伸
根据我们的实际情况来选择拉伸的类型,这个图片需要第三种拉伸方式。
Slices中Left,Right,Top,Bottom则分别代表左右上角保留的区域
Center属性代表中部的像素区域按哪种形式去拉伸,一种为Stretches(拉伸),一种为Tiles(平铺),这里我们选择Stretches。
3.设置完的图片是这个样子的
![](https://img.haomeiwen.com/i5229369/631d887550578525.png)