Re: iPad interface orientation basics
Re: iPad interface orientation basics
- Subject: Re: iPad interface orientation basics
- From: Rafael Cerioli <email@hidden>
- Date: Mon, 17 May 2010 13:39:06 -0400
First, make sure the "interfaceOrientation" property is correct on your view controller after the rotation.
If it's the case, check that your view can be resized properly (either with autoresizing masks or with a custom layoutSubviews, or any other custom mechanism).
If it's not the case, it means that your view controller's view is not the first view to be added to the window, or that your view controller is not in a TabBar/Navigation - controller hierarchy.
Le 17 mai 2010 à 11:58, sebi a écrit :
>
> On May 14, 2010, at 8:17 AM, David Duncan wrote:
>
>> On May 12, 2010, at 12:52 PM, sebi <email@hidden> wrote:
>>
>>> hello,
>>>
>>> sorry, this is probably a very simple thing, but i am quite puzzled right now.
>>>
>>> when i do this in my view controller:
>>>
>>> - (void)didRotateFromInterfaceOrientation:(UIInterfaceOrientation)fromInterfaceOrientation {
>>> CGSize size = self.view.frame.size;
>>> NSLog(NSStringFromCGSize(size));
>>> }
>>>
>>> the size is always {768, 1024}, regardless of the orientation. why is it not {1024, 768} in landscape mode? The view definitely changes its size, since it always fills the full screen...
>>
>> Because the frame is in the parent coordinate system, and technically that coordinate system doesn't change when you rotate. If you look at the bounds instead, you will find that they have changed as you expect, because the bounds is in the view's own coordinate system.
>> --
>> David Duncan
>
>
> Hello,
>
> Thanks, but sorry, I don't get it. Also the net is full of questions and very few answers regarding this topic, so I don't seem to be the only one.
> I have a ViewController with a view. In that view there is an UIImageView background subview. Now, when I rotate the device I want to switch the image of the UIImageview so it fills the view again without being distorted. The only working method I found out up to now is to determine the correct values for the views frames and bounds by try and error and to hardcode them into the didRotateFromInterfaceOrientation method. Isn't there any example that shows how this is done properly? I downloaded all of apple samplecode and didn't find anything:
>
> Thanks and regards,
> Sebastian Mecklenburg_______________________________________________
>
> 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
_______________________________________________
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