Hao
Hao

Reputation: 356

How to display UIView that's outside of screen in main.storyboard?

I'm working on a screen that has a UITableView below the screen(thus invisible) initially, but will pop up when user click on a button. I know it's not supposed to be seen on the screen, but just for the sake of design, is there a way to make it visible when I'm working on main.storyboard?

Please see the picture attached below. It's really hard to work on the UITableView when it's beneath the toolbar. How can I force xcode to display them so it's much easier to work on?

enter image description here

Upvotes: 3

Views: 1268

Answers (3)

vrwim
vrwim

Reputation: 14340

You can't, but you have 3 workarounds:

  1. Move it into view (Xcode will complain that it's not in the right position, but it doesn't matter)
  2. On the bottom left on your storyboard, you can open up the view hierarchy, you can find your element there for creating constraints, linking it with your code and everything else you'd want to do.
  3. Increase the visible size of the viewcontroller on your storyboard, trough selecting your viewcontroller on the storyboard, changing Simulated Size to freeform and increasing the values (will not affect size when running).

Upvotes: 2

rmp
rmp

Reputation: 3513

The easiest way to deal with this is to:

  1. open storyboard
  2. select the viewcontroller you want to edit
  3. open the Size Inspector
  4. Switch from Fixed to Freeform
  5. Type in a larger height (like 1000)

enter image description here

Upvotes: 2

Rory McKinnel
Rory McKinnel

Reputation: 8014

Simplest thing is to manually do what your button does in the app.

In the view hierarchy on the left, select your table view and move it down to the bottom. This will bring it to the front in interface builder.

When you are done, move it back.

I do this all the time and you get used to doing it. Just watch out for accidentally moving it inside another view when you drag it down or up.

Upvotes: 0

Related Questions