Created
April 30, 2012 11:04
-
-
Save ellneal/2557391 to your computer and use it in GitHub Desktop.
Static View at bottom of UIScrollView - place in layoutSubviews
This file contains 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
UIView *staticFooterView = <#static view#>; | |
CGRect visibleBounds = self.bounds; | |
CGRect staticFooterFrame = staticFooterView.frame; | |
CGRect contentRect = CGRectMake(0, 0, self.contentSize.width, self.contentSize.height); | |
if (CGRectGetMaxY(visibleBounds) > CGRectGetMaxY(contentRect)) { | |
staticFooterFrame = CGRectMake(visibleBounds.origin.x, CGRectGetMaxY(contentRect) - staticFooterFrame.size.height, staticFooterFrame.size.width, staticFooterFrame.size.height); | |
} | |
else { | |
staticFooterFrame = CGRectMake(visibleBounds.origin.x, CGRectGetMaxY(visibleBounds) - staticFooterFrame.size.height, staticFooterFrame.size.width, staticFooterFrame.size.height); | |
} | |
staticFooterView.frame = staticFooterFrame; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment