Re: rotating UIView without changing size
Re: rotating UIView without changing size
- Subject: Re: rotating UIView without changing size
- From: David Duncan <email@hidden>
- Date: Fri, 03 Aug 2012 09:59:10 -0700
On Aug 3, 2012, at 9:16 AM, Gerriet M. Denkmann <email@hidden> wrote:
> The code in basicView (an UIView) is:
>
> - (void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event
> {
> if ( self.sliderView == nil ) // load nib
> {
> NSBundle *mainBundle = [ NSBundle mainBundle ];
> SliderViewController *tem = [ [ SliderViewController alloc ] initWithNibName: @"Sliders"
> bundle: mainBundle
> biGroup: biGroup
> cubeGlView: self
> ];
> self.sliderViewController = tem;
> [ tem release ];
>
> self.sliderView = self.sliderViewController.view;
> self.sliderView.center = self.center;
> [ self addSubview: self.sliderView ];
> }
>
> self.sliderView.hidden = NO;
> }
As I alluded to earlier, if you are going to use view controller containment, you MUST use the containment API if you want sane behavior. The reason you are getting this behavior is that based on your greater conditions, the SliderViewController you just created is getting rotation callbacks, and since it doesn't have a parent view controller would assume it is a full screen view controller and sizes itself for that.
I would recommend you either 1) adopt view controller containment and do this addition in the view controller that owns basicView (which needs to be a subclass to do this properly) of 2) make SliderViewController not a subclass of UIViewController.
--
David Duncan
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden