2013-10-02 2 views
0

У меня есть UIPopoverController для ввода данных с помощью кнопки «Отмена» и «Сохранить». Оба отлично работают на iOS6. На iOS7 кнопки отображаются, но не переключаются (не запускаются их селекторами)UIBarButtonItem не доступен для просмотра в iOS7, когда в UIPopoverController на iPad

cancelButtonItem = [[UIBarButtonItem alloc] initWithTitle:@"Cancel" style:UIBarButtonItemStyleBordered target:self action:@selector(cancel)]; 
saveButtonItem = [[UIBarButtonItem alloc] initWithTitle:@"Save" style:UIBarButtonItemStyleDone target:self action:@selector(save)]; 

if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPad) { 
    UIBarButtonItem *flexibleSpace = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemFlexibleSpace target:nil action:nil]; 
    NSMutableArray * arr = [NSMutableArray arrayWithObjects:cancelButtonItem,flexibleSpace, saveButtonItem, nil]; 
    [_toolbar setItems:arr animated:YES]; 
} else { 
    //iPhone 
    self.navigationItem.leftBarButtonItem = cancelButtonItem; 
    self.navigationItem.rightBarButtonItem = saveButtonItem; 
} 

Любые идеи?

+0

У вас есть все проблемы? – SasaT

+0

Это оказался UIToolbar, расположенный над UINavigationController. Решение заключалось в том, чтобы избавиться от UINavigationController. –

+0

Представьте свой комментарий в качестве ответа – Krishnan

ответ

0

Это оказался UIToolbar, расположенный над UINavigationController. Решение заключалось в том, чтобы избавиться от UINavigationController.

Смежные вопросы