-
-
Save pilky/1385576 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- (void)performLayout | |
{ | |
[super performLayout]; | |
myScrubView.frame = self.bounds; | |
BOOL reload = NO; | |
UIInterfaceOrientation orientation = [[UIApplication sharedApplication] statusBarOrientation]; | |
if (orientation == UIInterfaceOrientationPortrait) | |
{ | |
myPortraitView = [self _viewBySwitchingFromView:myLandscapeView toView:myPortraitView]; | |
} | |
else | |
{ | |
myLandscapeView = [self _viewBySwitchingFromView:myPortraitView toView:myLandscapeView]; | |
} | |
if (reload) | |
[self reloadData]; | |
} | |
- (NSView *)_viewBySwitchingFromView:(NSView *)aFromView toView:(NSView *)aToView { | |
aFromView.alpha = 0.0; | |
if (aToView) { | |
aToView.alpha = 1.0; | |
} else { | |
aToView = [[UIView alloc] init]; | |
[myScrubView addSubview:aToView]; | |
reload = YES; | |
} | |
aToView.frame = myScrubView.bounds; | |
return aToView; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment