Xcode - 有没有办法将组件从一个视图拖到另一个视图而不会丢失它的框架? [英] Xcode - Is there a way to drag a component from one view to another without losing its frame?

查看:60
本文介绍了Xcode - 有没有办法将组件从一个视图拖到另一个视图而不会丢失它的框架?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想要做的是在Xcode的界面构建器中将组件/视图从一个超级视图拖动到另一个超级视图,而不必重置其帧/位置。

What I'd like to do is drag a component/view from one superview to another in Xcode's interface-builder without having its frame/position be reset.

Xcode执行此操作时的默认行为似乎是使视图在新的超视图中垂直和水平移动,同时保留其尺寸。这非常令人沮丧,因为这意味着需要在新的superview中手动重新定位视图。但是在我移动之前我已经正确定位了它,所以我希望Xcode能够记住它的所有属性而不仅仅是它的宽度/高度。这可能吗?

Xcode's default behavior when doing this appears to be to center the view being moved vertically and horizontally in its new superview, while preserving its dimensions. This is extremely frustrating, as it means that the view needs to be manually repositioned in its new superview. But I had it positioned correctly before I moved it, so I'd like Xcode to just remember all attributes of its frame instead of just its width/height. Is this possible?

推荐答案

另一个解决方案:


  1. 在子视图中选择所需的项目,然后

  2. (在工具栏中)编辑器 - >嵌入 - >视图类型以嵌入。

这篇关于Xcode - 有没有办法将组件从一个视图拖到另一个视图而不会丢失它的框架?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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