user773578
user773578

Reputation: 1161

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 it in the display stack to be visible?

Upvotes: 0

Views: 213

Answers (3)

mpemburn
mpemburn

Reputation: 2884

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:

enter image description here

Upvotes: 0

Nekto
Nekto

Reputation: 17877

  1. Size of view is set using its frame property.

  2. You can play with alpha property of that view to change its transparency.

Upvotes: 3

Duncan Babbage
Duncan Babbage

Reputation: 20177

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?

Upvotes: 0

Related Questions