Я хочу выводить UINavigationBar на экран, когда появляется модальный UIView, как это происходит в Reeder.
Я использую превосходный SVWebViewController (https://github.com/samvermette/SVWebViewController) для управления созданием веб-браузера из mustStartLoadWithRequest
Код анимации от http://www.theappcodeblog.com/2011/06/02/iphone-app-animation-tutorial-animate-a-uiview-frame/
Все работает, так как в навигационной панели находится за пределами экрана, но оставленное пространство (которое я хочу оживить в нем) - ЧЕРНОЕ. Остальная часть представления / веб-просмотра БЕЛАЯ.
Как я могу сделать пространство, выделенное для панели навигации белым, т.е. фон вида белым?
Там нет xib.
Я не могу найти упоминания о панели навигации в SVWebViewController (только добавление панели инструментов)
- (BOOL)webView:(UIWebView *)webView shouldStartLoadWithRequest:(NSURLRequest *)request navigationType:(UIWebViewNavigationType)navigationType {
NSLog(@"They clicked: %@", request);
NSURL *requestURL = [request URL];
if ([[requestURL scheme ] isEqualToString: @"http"] || [[requestURL scheme] isEqualToString: @"https"]) {
NSLog(@"Web link %@",requestURL);
SVModalWebViewController *webViewController = [[SVModalWebViewController alloc] initWithURL:requestURL];
webViewController.modalPresentationStyle = UIModalPresentationFullScreen;
webViewController.modalTransitionStyle = UIModalTransitionStyleCrossDissolve;
webViewController.availableActions = SVWebViewControllerAvailableActionsOpenInSafari | SVWebViewControllerAvailableActionsCopyLink | SVWebViewControllerAvailableActionsMailLink;
// ios5
if ([[UINavigationBar class]respondsToSelector:@selector(appearance)]) {
// Create image for navigation background - portrait
UIImage *NavigationPortraitBackground = [[UIImage imageNamed:@"navbar_bg_portrait~iPad"]
resizableImageWithCapInsets:UIEdgeInsetsMake(0, 0, 0, 0)];
// Create image for navigation background - landscape
UIImage *NavigationLandscapeBackground = [[UIImage imageNamed:@"navbar_bg_portrait~iPad"]
resizableImageWithCapInsets:UIEdgeInsetsMake(0, 0, 0, 0)];
// Set the background image all UINavigationBars
[[UINavigationBar appearance] setBackgroundImage:NavigationPortraitBackground forBarMetrics:UIBarMetricsDefault];
[[UINavigationBar appearance] setBackgroundImage:NavigationLandscapeBackground forBarMetrics:UIBarMetricsLandscapePhone];
[[UINavigationBar appearance] setBackgroundColor:[UIColor whiteColor]];
// The tintcolor affects the button colour
UIColor* col = OPAQUE_HEXCOLOR(0xdb536a);
[[UIBarButtonItem appearance] setTintColor:col];
} else {
// Style the Nav Bar ios4
[webViewController.navigationBar applyCustomTintColor];
}
[self presentModalViewController:webViewController animated:YES];
// -> This code hides the UINavigationBar before animation
CGRect navBarFrame = webViewController.navigationBar.frame;
navBarFrame.origin.y = -navBarFrame.size.height;
// set the position of the bar
webViewController.navigationBar.frame = navBarFrame;
// <- end Hide code
return NO;
}
return YES;
}
ТИА