Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

send subview to back from storyboard ios

Is there a way that I can add new imageView over all other views and send that view to back of my viewController directly from storyboard? I don't want to create ImageView in code and use sendSubviewToBack method for that.

like image 323
lugonja Avatar asked Dec 13 '13 15:12

lugonja


People also ask

How do I send to back in XCode?

Click the Editor menu, then select Arrange > Send to Back. Show activity on this post. In XCode 8 you go to the menu bar on the top of the screen then click Edit > Arrange > Send to Back. This also Works for moving an item behind a single item or in front of an item.

How do I add a subview to a storyboard?

Select the subview and drag over the view entry in the Objects Explorer of storyboard. Once you leave the mouse hold, the parent view will have a triangle indicating your subview has become its child and the subview will have a bigger indent than your view.

How do you edit storyboard on Iphone?

In Xcode 9.2, simply go to your Storyboard and go to the bottom, Click View As and choose a device you like.


2 Answers

In Interface Builder check the left sidebar and you will see the view hierarchy as shown below.

Just add your view as normal, then drag it up the view hierarchy to the top of the list in 'View' and it will be at the bottom of the stack.

In the example below There is a container view in the root view controller view then Image View and then all the labels are 'on top' of that bottom image view.

View hierarchy

like image 69
Neonkoala Avatar answered Oct 16 '22 10:10

Neonkoala


Select the view in the Interface Builder, and then do Editor -> Arrange -> Send to Back

enter image description here

You can also rearrange the views in the view list in the left panel of the IB window. The views that are on top of that list will also appear on top in the app.

like image 24
TotoroTotoro Avatar answered Oct 16 '22 08:10

TotoroTotoro