开发者

Set the size of a UIViewControllers view

开发者 https://www.devze.com 2023-04-09 04:39 出处:网络
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 displ

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?


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

  2. 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:

Set the size of a UIViewControllers view

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号