xcode 除非缩放,否则无法在视图控制器中拖放对象

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/9437703/
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-14 23:26:11  来源:igfitidea点击:

Can't drag/drop objects in View Controller unless zoomed

xcodeio

提问by DrTchocky

I've seen many videos of people working with xcode 4+ in which they can drag/drop objects onto their views with no problem (e.g @2:20 http://www.youtube.com/watch?v=It2fAolaFV0). I, on the other hand, have to select the View Controller of interest, and zoom in a crazy amount before I can drag/drop objects onto it (until I can't see anything but background of UIView)

我看过很多使用 xcode 4+ 的人的视频,他们可以毫无问题地将对象拖放到他们的视图上(例如 @2:20 http://www.youtube.com/watch?v=It2fAolaFV0)。另一方面,我必须选择感兴趣的视图控制器,并在我可以将对象拖放到它之前疯狂地放大(直到我除了 UIView 的背景之外什么都看不到)

I can't seem to find any preference for this (or information on it), so thought I might ask here. Does anyone know how to change this?

我似乎找不到对此的任何偏好(或有关它的信息),所以我想我可能会在这里问。有谁知道如何改变这个?

回答by ChArAnJiT

No there is no way of changing this. You have to zoom the view to one view controller to be able to drag and drop controls.

不,没有办法改变这一点。您必须将视图缩放到一个视图控制器才能拖放控件。

回答by choff

ah, here we are two years later and XCode 5.1 exhibits the same behavior.

啊,两年后,XCode 5.1 表现出相同的行为。

Double click anywhere on the storyboard - the editor will zoom to the correct level for placing objects.

双击情节提要上的任意位置 - 编辑器将缩放到正确的级别以放置对象。

回答by spring

The Storyboard view has to be at 100% in order to add elements. This is a limitation of the Storyboard implementation. You can get the ViewController you are working on to zoom and center by double-clicking on it's icon in the bottom bar under it.

Storyboard 视图必须为 100% 才能添加元素。这是 Storyboard 实现的一个限制。您可以通过双击它下方底部栏中的图标来获取您正在处理的 ViewController 以进行缩放和居中。

File a bug/feature request to Apple

Apple提交错误/功能请求

回答by Khawar Ali

You have to zoom in first but instead of using the zoom+ and zoom- buttons, simple double click on the particular view controller and it will just to the required size for dragging objects.

您必须先放大,而不是使用 zoom+ 和 zoom- 按钮,只需双击特定的视图控制器,它就会达到拖动对象所需的大小。