0

I have a Image View on my storyboard, and when I am trying to use it as a background. No matter what I do, it always stays on top. How would I change it so that it would be a background image, I don't care weather I do it programmatically through swift or through another way.

1

3 Answers 3

2

In the Xcode Interface Builder, you can adjust which views are in the front by selecting the view and going to Editor -> Arrange -> Send to Front, Back, etc.

This can also be done programmatically using UIView methods like bringSubviewToFront:

Sign up to request clarification or add additional context in comments.

Comments

1

By moving any of item up/down you can set their layer state. The first one will be on back then second will appear on the first one then.... last one will appear on top most.

I hope this will help you.

By moving any of item up/down you can set their layer state

Comments

0

If you decide to do it programmatically, you can modify the zPosition property of the view:

myImageView.layer.zPosition = 1

Higher numbers are closer to your face, lower numbers are closer to the screen. So to set your image view as a background, make sure the other views have higher z-positions than it.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.