0

I have a UIView that I've designed in xib:

enter image description here

You can see that it consists of three things: Two large views on either side which are just empty for now, and then a gray bar in the middle (which is itself a UIView).

In some conditions, I want to draw horizontal blue lines on top of the entire page. But what's happening is that because of the views on the left and right, the horizontal blue lines are only showing in the middle. How can I draw ON TOP of the views that exist within my view? In other words, how do I get those blue lines to show up on the whole screen (the drawing commands have them being drawn much longer than they show up as). Stated another way, I need to set the Z dimension of my blue lines to be on top of everything else.

enter image description here

CodeGuy
  • 28,427
  • 76
  • 200
  • 317

1 Answers1

1

I would have this sort of view hierarchy:

Main view has 3 subviews: left, right, center. Center is in front of left and right, and is sized so that it fits the width of the blue bars.

Center has a subview that is the vertical line, and a subview that contains the blue lines, and is made to have a transparent background. The vertical line view should have Z dimension higher than the one containing the blue lines.

When you draw the center, you can set the blue lines subview to be visible/invisible as needed.

mleyfman
  • 635
  • 4
  • 13