2014-11-04 35 views
0

我使用標準的ABPeoplePickerNavigationController,當我用聯繫人拖動表時,我看到頂欄是透明的。我無法解決它。它看起來很糟糕。ABPeoplePickerNavigationController透明頂欄

我試着將[UIColor whiteColor]設置爲我可以接觸到的所有東西:navigationBar,ABPeoplePickerNavigationController的所有子視圖以及它的所有子視圖topViewController。我試圖設置不同的酒吧風格導航欄。沒什麼幫助。

Transperent top

這裏是代碼

@interface MNFindClientVC() <ABPeoplePickerNavigationControllerDelegate> 
@property (nonatomic, strong) ABPeoplePickerNavigationController *addressBookController; 
-(void)openPhoneBook; 
@end 

@implementation MNFindClientVC 
-(void)viewDidLoad 
{ 
     [super viewDidLoad]; 
     self.navigationItem.rightBarButtonItem = [[UIBarButtonItem alloc] initWithImage:[UIImage imageNamed:@"phonebook"] style:UIBarButtonItemStyleBordered target:self action:@selector(openPhoneBook)]; 
     self.addressBookController = [[ABPeoplePickerNavigationController alloc] init]; 
     self.addressBookController.peoplePickerDelegate = self; 
} 

-(void)openPhoneBook 
{ 
    [self presentViewController:self.addressBookController animated:YES completion:nil]; 
} 
@end 

對不起,我的英語水平。謝謝:)

+0

對不起,它仍然是我的工作,你可以註釋掉rightBarButtonItem線和測試:您可以通過在ABPeoplePickerNavigationContrller時,用下面的代碼(在iOS 8的測試)禁止UINavigationBar的的半透明解決這個問題再次。 – gabbler 2014-11-05 15:00:46

回答

1

我在使用半透明的UINavigationBar時遇到同樣的問題。

_addressBookController = [[ABPeoplePickerNavigationController alloc] init]; 
[_addressBookController setPeoplePickerDelegate:self]; 

[[UINavigationBar appearanceWhenContainedIn:[ABPeoplePickerNavigationController class], nil] setTranslucent:NO]; 

[self presentViewController:_addressBookController animated:YES completion:nil];