Well, I used the macro UIDeviceOrientationIsLandscape, I'm assuming that this is for both sides: #define UIDeviceOrientationIsPortrait(orientation) ((orientation) == UIDeviceOrientationPortrait || (orientation) == UIDeviceOrientationPortraitUpsideDown) #define UIDeviceOrientationIsLandscape(orientation) ((orientation) == UIDeviceOrientationLandscapeLeft || (orientation) == UIDeviceOrientationLandscapeRight)
So the else only occours when the device is in portrait (being normal or upside down), right? So, if scroll view layout during scroll, I cannot do this resizing in layoutSubview, and should do this in shouldAutorotateToInterfaceOrientation method in my controller? Em 26/06/2011, às 16:07, David Duncan escreveu: > Yes, scroll views layout during scroll. But the reSl problem is likely in > your use of device orientation. Specifically unlike interface orientation, > not being landscape is not the same ad bring portrait, as device orientation > has 3 additional orientations. If you want to match your interface > orientation, us the interfaceOrientation property on your view controller. > > That said, why layout that way at all? Why not base your layout on the views > bounds instead? > > -- > David Duncan @ My iPhone > > On Jun 26, 2011, at 11:39 AM, Tales Pinheiro de Andrade <tal...@me.com> wrote: > >> Hi. >> >> I have a few custom views of three kind inside a custom UIScrollview. I'm >> trying to resize these custom views as the device change the orientation. >> >> I added these custom views programatically to the custom UIScrollView. I >> implemented in the custom UIScrollview the below method >> >> - (void)layoutSubviews { >> UIDeviceOrientation currentOrientation = [[UIDevice currentDevice] >> orientation]; >> if (UIDeviceOrientationIsLandscape(currentOrientation)) { >> for (id view in [self subviews]) { >> if ([view isKindOfClass:[ECIndexComponent class]] || _______________________________________________ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) 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: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com