Skip to content

Instantly share code, notes, and snippets.

@hatfinch
Created November 22, 2011 10:46
  • Star 0 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
Star You must be signed in to star a gist
Embed
What would you like to do?
- (void)performLayout
{
[super performLayout];
myScrubView.frame = self.bounds;
BOOL reload = NO;
UIInterfaceOrientation orientation = [[UIApplication sharedApplication] statusBarOrientation];
if (orientation == UIInterfaceOrientationPortrait)
{
myLandscapeView.alpha = 0.0;
if (myPortraitView)
myPortraitView.alpha = 1.0;
else
{
myPortraitView = [[UIView alloc] init];
[myScrubView addSubview:myPortraitView];
reload = YES;
}
myPortraitView.frame = myScrubView.bounds;
}
else
{
myPortraitView.alpha = 0.0;
if (myLandscapeView)
myLandscapeView.alpha = 1.0;
else
{
myLandscapeView = [[UIView alloc] init];
[myScrubView addSubview:myLandscapeView];
reload = YES;
}
myLandscapeView.frame = myScrubView.bounds;
}
if (reload)
[self reloadData];
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment