简体   繁体   中英

can't drag a tableview or scrollview into a storyboard viewcontroller

I have an existing view controller derived from UIViewController that I'm trying to drag a view into but the storyboard editor won't let me. If I create a new viewcontroller in storyboard it will let me and I notice it has some autolayout controls... something the original viewcontroller doesn't have.

I don't want to delete the original view controller and recreate since it already has a lot of the push segues and what not hooked up to it. How can I get it to allow me to drop views/tableviews onto the storyboard surface of the viewcontroller?

Have you try to :

  • Copy your controller into a new storyboard and test to add a view ?
  • Add other element ? Likee UIButton, UISwitch etc... Can you do it or not ?

Have you try to add it like that ( drag & drop on view hierarchy ) ?

在此处输入图片说明

Autolayout is a way to manage how views are placing comparing to others views.

You can activate or desactivate by clicking on your viewcontroller and by clicking this checkbox, it will affect to whole storyboard :

IB激活自动布局

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM