在 Xcode 中调整图像大小?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/38584813/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-15 09:04:49  来源:igfitidea点击:

Resizing Image in Xcode?

iosobjective-cswiftxcodeide

提问by tryKuldeepTanwar

Is there any way I can resize an image that I copy into my project, according the the size I need in pixels for example maybe I want to reduce the height and width by 100px then add it to my imageView or any other object. are there any tools that Xcode provide within the Xcode. I want to do it using interface without any programming so is there any way?

有什么方法可以调整我复制到我的项目中的图像的大小,例如根据我需要的像素大小,也许我想将高度和宽度减少 100 像素,然后将其添加到我的 imageView 或任何其他对象。Xcode 在 Xcode 中是否提供了任何工具。我想在没有任何编程的情况下使用界面来做到这一点,所以有什么办法吗?

回答by mixth

The simple answer would be "NO".

简单的答案是“不”。

I do not aware of any way to use Xcode resizing images.

我不知道有什么方法可以使用 Xcode 调整图像大小。

The easiest method for me is to right click on any image and select "Open with External Editor". Previewshould be opened and the app is quite simple to use.

对我来说最简单的方法是右键单击任何图像并选择“使用外部编辑器打开”。应打开预览,该应用程序使用起来非常简单。

回答by Nattudurai

Assuming that you are referring to the layout in storyboard/IB.

假设您指的是情节提要/IB 中的布局。

To get the native size of the image just select the image and press Command + =on the keyboard. the to re-size it proportionally select the corner and hold down the shift key when you re-size it.

要获得图像的原始尺寸,只需选择图像并按下Command + =键盘上的即可。按比例重新调整大小 选择角并在重新调整大小时按住 shift 键。