UIView Subview Does not autoresize on orientation change?

If so, that's the cause of the problem. The autoresize property determines how the view resizes relative to it's superview. If it doesn't have a superview it won't resize.

If so, that's the cause of the problem. The autoresize property determines how the view resizes relative to it's superview. If it doesn't have a superview it won't resize.

Perhaps using backView setdden:YES instead of backView removeFromSuperview will be sufficient for your needs.

Unfortunately, this happens even when backView is in the superview too. And I just tried out your suggestion to use backView setdden:YES and it didn't do the trick either. – Jason Aug 25 '10 at 5:35 Is backView.

AutoresizesSubviews == YES? Presumably it would be since it's the default, but so far that's the only other thing I can think of. – imaginaryboy Aug 25 '10 at 5:42 Yes, it is equal to YES.

– Jason Aug 25 '10 at 14:21 Is there a code sample you can post that actually exhibits the incorrect behavior? – imaginaryboy Aug 25 '10 at 14:44.

In the end, the solution I found was simply to separate my UIViews into separate UIViewControllers, and make sure that any views that I wanted to be able to rotate only had one UIView.

I had the same problem, here is how I fixed it based on imaginaryboy's suggestions (thanks! ) Add the backview to the viewcontroller at viewDidLoad and hide it at the same time. Show it when needed, Set the resizing of the backview to UIViewAutoresizingFlexibleWidth in IB (or code I guess, I used IB).

Not that this is the same problem, but I found a similar problem when adding 2 subviews in my application:didFinishLaunchingWithOptions method. Since your reference above is using self. View addSubview:view, I would understand that to mean that self is not your UIWindow.

When adding an additional view controller to your App Delegate window (UIWindow), the second view controller will NOT receive any rotation events and will never rotate. Only the first view controller added to UIWindow will rotate. See:Technical Q&A QA1688 I believe this also affects views added after the first view where the first view is later removed from the superview.

I ended up following the suggestion I read elsewhere to use separate views for each orientation, thereby eliminating the need to worry about resizing behavior. As always, YMMV.

Or; if you want to avoid an additional controller, you can achieve the same effect by setting view. Frame in willRotateToInterfaceOrientation:: like so if(UIInterfaceOrientationIsLandscape(UIApplication sharedApplication statusBarOrientation)) ;//set stubborn view. Frame for landscape orientation else ; //set stubborn view.

Frame for portrait orientation Although it feels like a hack; it's simple.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions