Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

In Xcode Interface Builder - why are the options in the Editor--->Arrange menu (containing Send to Front, Send to Back) often disabled?

What I'm trying to do is simple: bring a label in front of an image within a subview.

But all of the options for arranging are disabled/un-selectable when my label is selected. I find this happens often.

What could be the reason that I'm almost never allowed to change the z-axis of my objects in the Arrange menu? Is it a better practice to avoid this feature and set the order of views programmatically?

like image 810
darkheartfelt Avatar asked Aug 12 '13 19:08

darkheartfelt


People also ask

What function does Interface Builder in Xcode provide?

Xcode has a built-in tool called Interface Builder that you can use to create interfaces visually. In this unit, you'll learn how to navigate through Interface Builder, add elements onto the canvas, and interact with those elements in code.

Where is Interface Builder in Xcode?

Creating the interface First, in Xcode, go to the Resources folder from the tree view on the left and select MainMenu. xib . It will open in the main view. This is where you are going to build you UI.

How do I add constraints in Xcode?

To create constraints select the button and click the Align icon in the auto layout menu. A popover menu will appear, check both “Horizontal in container” and “Vertically in container” options to center the button on the screen. Then click the “Add 2 Constraints” button. Run the application.


1 Answers

It can depend on how you have selected the label (similar to how the label can only be moved with the keyboard when selected in some ways).

A simple alternative is to look at the list of view in the pane on the left and to drag the views up and down to change the order.

like image 61
Wain Avatar answered Sep 22 '22 06:09

Wain