Reputation: 33674
I have a UIViewController view that I wanted to insert below a subview:
[self.view insertSubview:ntVC_.view belowSubview:shareView_];
The shareView frame Y is 959 and it's height is 44. So when doing this shouldn't ntVC frame Y be at 1004? However it's at 925 now. Any idea?
Upvotes: 1
Views: 130
Reputation: 38728
The method insertSubview:belowSubview:
refers to the view stack not a view's coordinates.
You need to do the calculation of where to position the view yourself.
+-------+ +-------+
| | | |
| A +-------+ | A |----+
| | | | | |
+----| B | +-------+ |
| | | B |
+-------+ +-------+
In terms of the view stack
A
is below
B
A
is above
B
Upvotes: 7