Xcode 8在Interface Builder中扭曲和拉伸图像 [英] Xcode 8 distorting and stretching image in Interface Builder

查看:78
本文介绍了Xcode 8在Interface Builder中扭曲和拉伸图像的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

将3个PNG文件添加到Xcode图像资产文件夹(@ 1x,@ 2x,@ 3x).使用图像向Interface Builder添加按钮时,仅在Interface Builder中,它会变形 .

Added 3 PNG files to the Xcode image assets folder (@1x, @2x, @3x). When using the images to add a button to Interface Builder, it appears distorted only in Interface Builder.

这在Xcode 7中很好用.有人知道我需要做些什么来解决此问题吗?

This worked fine in Xcode 7. Does anyone know there any specific that I need to do to fix this issue?

这是我对@ 1x文件的图像资产的切片设置.每个值的@ 2x和@ 3x分别为12和18.

Here are my slicing settings for the image asset for the @1x file. The @2x and @3x are at 12 and 18 for each value, respectively.

这是用户看到的内容:

这是Interface Builder中显示的内容:

Here is what is displayed in Interface Builder:

对于图像的约束,我有特定的高度和宽度(在这种情况下,高度= 44,宽度= 130),每当我关闭水平和垂直切片时,拉伸似乎都在Interface Builder中停止了.

I have a specific height and width for the constraints of the image (in this instance, height = 44, width = 130) and whenever I turn off horizontal and vertical slicing, the stretching seems to stop in Interface Builder.

推荐答案

这是Interface Builder中一个完善的错误(我在2013年报告了该错误!).正如您正确地说的那样,在不同版本的Xcode中,问题在不同程度上出现和发展.但这不会影响运行时发生的事情,因此不必担心.

It's a well-established bug in Interface Builder (I reported it in 2013!). As you rightly say, the problem comes and goes to varying degrees in different versions of Xcode. But it doesn't affect what happens at runtime, so don't worry about it.

这篇关于Xcode 8在Interface Builder中扭曲和拉伸图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆