Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Xcode 12 Unable to use Interface Builder to add subview to scrollview

Using Xcode 12 interface builder, I am unable to drag a view into a scrollview. This seems to be a very simple task that was working fine for a few years. I'm not sure what I am missing. Dragging views into other views is working perfectly though.

like image 205
Marlo Quidato Avatar asked Oct 05 '20 09:10

Marlo Quidato


Video Answer


2 Answers

I have the same issue on Xcode 12.0.1. As a workaround you can start by setting up the root view of your scroll view content, select it and use the Editor / Embed in / Scroll View command (or alternatively, the last bottom right icon in the canvas). Then you can add to the root content view normally by drag & dropping.

like image 62
amadour Avatar answered Sep 22 '22 21:09

amadour


I've wasted more time than I'd like to admit on this one. You should drag directly into the drawing canvas, not into the view hierarchy inspector.

like image 31
Itamar Manor Avatar answered Sep 25 '22 21:09

Itamar Manor