I want to make the a label appear over an image view. But when I place the label over it it disappears. Whats the best way around this?
I have a couple of labels over my image view. When I build and run it the labels appear fine. But on the storyboard when I place ui items such as a label over my image view it doesn't show. How can I make this show
As seen on the screen shot I can't see my labels It appears when I build and run but on the story board the image view hides it this is still a problem.
In a story board, if you place the label on top of the image view it will appear that way. Just make sure that you have the proper constraints on both the image view and the label so that they would be on top of each other and it should work. To answer your question, putting a label on top of an image view does not make it disappear.
This would put the label in front of the image view:
and this would put it behind the imageview
Just replace the order from the side menu in storyboard. Put it below the image view and it will be on top
The method has been updated since swift 3
What has worked for me and hopefully for you is using :
YourView.bringSubview(toFront: yourelementA)
YourView.bringSubview(toFront: yourelementB)
Alternatively you could use the following to send the object that is in the front:
YourView.sendSubview(toBack: yourelementC)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With