Ios – Xcode – Is there a way to drag a component from one view to another without losing its frame

interface-builderiosxcode

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'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?

Best Answer

Another solution:

  1. Select the items you want in your subview, then
  2. (in the tool bar) Editor > Embed In > view type to embed in.
Related Topic