Set the size of a UIViewControllers view
How does one set the size of a UIViewController view so that the view behind it is visible? Or will setting a UIViewControllers view to clear, allow for the view below开发者_Python百科 it in the display stack to be visible?
Size of view is set using its
frame
property.You can play with
alpha
property of that view to change its transparency.
This previous question and the one it links to suggests what you want may not be possible, if you are thinking that the parent view is just occluded by the current view and not removed?
Changing the alpha of the UIViewController will affect everything that you place on the controller -- and that may not be what you want. What you can do is to make the view's background clear, then add another view with a suitable background color (black, white or whatever), and change the alpha of that view to make it translucent. You can then place controls on top of the translucent view and they will be opaque. The results look like this:
精彩评论