Created
September 4, 2012 15:10
-
-
Save badeen/3622184 to your computer and use it in GitHub Desktop.
Resizing map view in table view header and resizing.
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)scrollViewDidScroll:(UIScrollView *)scrollView | |
{ | |
CGPoint contentOffset = scrollView.contentOffset; | |
UIView *header = self.tableView.tableHeaderView; | |
if (contentOffset.y <= 0.0f) { | |
header.frame = CGRectMake(CGRectGetMinX(header.frame), contentOffset.y, CGRectGetWidth(header.frame), CFY_DISCOVER_TABLE_HEADER_MIN_HEIGHT - contentOffset.y); | |
[self.mapView setCenterCoordinate:self.mapView.userLocation.coordinate animated:NO]; | |
} else { | |
header.frame = CGRectMake(CGRectGetMinX(header.frame), 0.0f, CGRectGetWidth(header.frame), CFY_DISCOVER_TABLE_HEADER_MIN_HEIGHT); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment