iphone - Always center UIView -
I have a small UIView that should always appear in the center of the screen. It works great for portrait mode but is not in the scenario.
To use the UIView:
myView.frame = CGRectMake ((visibleArea.size.width - MY_VIEW_WIDTH) / 2, (vieweria.areight - MY_VIEW_HEIGHT ) / 2, MY_VIEW_WIDTH, MY_VIEW_HEIGHT); MyView.autoresizingMask = (UIViewAutoresizingFlexibleTopMargin | UIViewAutoresizingFlexibleBottomMargin | UIViewAutoresizingFlexibleLeftMargin | UIViewAutoresizingFlexibleRightMargin);
What could be any thoughts?
Why not try
myView.center = controller view.center
Comments
Post a Comment