У меня есть мое приложение здесь, которое поддерживает iOS 5.1 и новее. Тем не менее, я хотел бы скрыть кнопку камеры ниже, чем iOS 6.x. Как я могу это сделать? Вот как я добавляю Camerabutton:Я хотел бы скрыть кнопку в iOS 5.x, но не в iOS 6.x
- (BOOL)tabBarController:(UITabBarController *)tabBarController shouldSelectViewController:(UIViewController *)viewController {
if ([viewController isKindOfClass:[ATWebViewController class]]) {
NSURL *url = nil;
if (viewController.tabBarItem.tag == 0) {
url = [NSURL URLWithString:@"http://----.de"];
}
else if (viewController.tabBarItem.tag == 1) {
url = [NSURL URLWithString:@"http://----.de"];
}
// если viewController.tabBarItem.tag == 0 ATWebViewController * webViewController = [[ATWebViewController Alloc] initWithNibName: ноль расслоение: ноль URL: URL];
UINavigationController *navigationBarController = [[UINavigationController alloc] initWithRootViewController:webViewController];
navigationBarController.navigationBar.tintColor = ATNavigationBarTintColor;
if (viewController.tabBarItem.tag == 0) {
webViewController.navigationItem.rightBarButtonItem = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemDone target:self action:@selector(dismissWebView)];
webViewController.navigationItem.leftBarButtonItem = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemCamera target:self action:@selector(TakePhoto)];
}
else if (viewController.tabBarItem.tag == 1) {
webViewController.navigationItem.rightBarButtonItem = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemDone target:self action:@selector(dismissWebView)];
}
navigationBarController.modalPresentationStyle = UIModalPresentationFullScreen;
[self presentModalViewController:navigationBarController animated:YES];
return NO;
}
return YES;
}
Почему вы хотите это сделать? Есть ли какой-то API 6.x для камеры? – rmaddy
Мы просто реализуем камеру для рынка, который является webView. Загрузка изображений в webView поддерживается только в iOS 6. Поэтому кнопка не имеет смысла в iOS 5.1.x –