У меня есть UIImagePickerController, представленный как модальный в UIPopoverController в iOS 7. Когда он представлен, я не вижу кнопки отмены. Я попытался вставить leftBarItem в его navigationBar:iOS 7 set UIImagePickerController leftBarItem
picker.navigationItem.leftBarButtonItem = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemCancel target:self action:@selector(dismissModalViewControllerAnimated:)];
Но это не работает.
Вот как я представил подборщика:
if (SYSTEM_VERSION_GREATER_THAN_OR_EQUAL_TO(@"7.0")) {
[picker.navigationBar setTranslucent:NO];
[picker.navigationBar setBarStyle:UIBarStyleBlackOpaque];
[picker.navigationBar setBarTintColor:barGray];
}else{
[picker.navigationController.navigationBar setTintColor:barGray];
}
[self presentViewController:picker animated:YES completion:^{
//I also tried to put the leftBarItem setting code here. Doesn't work either.
}];
у кого есть какие-нибудь идеи?
Я уверен, что 'navigationItem' является' nil' в этой точке. – Kevin
Это так. Но почему? – randomor
На самом деле 'navigationItem' не ноль, но' leftBarButtonItem' способен установить, но не корректный viewcontroller. – randomor