In one view controller, such as the UINavigationController, an MKMapView is created with a frame the size of the top half of the view and adds it as a subpoint of your view controller. Then I create a UIToolbar to hold your buttons and make the top of its frame with the bottom of MKMapView. Finally, create a UITableView with it, with a frame slightly lower than the rest (make sure you include its delegates).
Then assign a target to your UIBarButtonItem, which will cause the card to go full-screen to a method that animates frames of all three types, for example:
[UIView animateWithDuration:0.24 delay:0.0 options:UIViewAnimationCurveEaseOut animations:(void (^)(void)) ^{ self.toolbar.frame = CGRectMake(0, MAP_HEIGHT_FULLSCREEN, 320, TOOLBAR_HEIGHT); self.mapView.frame = CGRectMake(0,0,320,MAP_HEIGHT_FULLSCREEN); self.tableView.frame = CGRectMake(0, MAP_HEIGHT_FULLSCREEN+TOOLBAR_HEIGHT, 320, MAP_HEIGHT_FULLSCREEN-MAP_HEIGHT); } completion:^ (BOOL finished){} ];
Steve moser
source share