Resizing UIView

LippelLippel DEMember ✭✭
edited February 2018 in Xamarin.iOS

Hello,

I want to make an UIView fit the whole screen size.
I also have this UIView in a custom renderer, because I want to use it in my pcl project.

When I create the UIView I can set its size correctly with this line:
var myUIView = new UIView(UIScreen.MainScreen.Bounds)

But when the device orientation is switched, I dont know how to resize it to fit the screen.
I tried settings following properties on myUIView:

AutoresizingMask = UIViewAutoresizing.All
AutosizesSubviews = true

But it didnt have any effect. Also tried resetting the size of the UIViews Bounds in its override LayoutSubviews() method.

Sign In or Register to comment.