[英]ABPeoplePickerNavigationController transparent top bar
I use standard ABPeoplePickerNavigationController and when I had dragged table with contacts I saw that top bar is transparent. 我使用标准的ABPeoplePickerNavigationController,当我拖动带有联系人的表时,我看到顶部的条是透明的。 I can't solve it.
我解决不了 It looks awful.
看起来糟透了。
I tried to set [UIColor whiteColor] to everything I can reach: navigationBar, all subviews of ABPeoplePickerNavigationController and all subviews of it's topViewController. 我试图将[UIColor whiteColor]设置为我可以到达的所有内容:navigationBar,ABPeoplePickerNavigationController的所有子视图以及topViewController的所有子视图。 I tried to set different bar styles to navigation bar.
我试图为导航栏设置不同的栏样式。 Nothing help.
没什么
Here is code 这是代码
@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
Sorry for my english. 对不起我的英语不好。 Thank you:)
谢谢:)
I had the same problem when using a UINavigationBar that was translucent. 使用半透明的UINavigationBar时,我遇到了同样的问题。 You can solve this problem by disabling translucency of the UINavigationBar when in a ABPeoplePickerNavigationContrller with the following code (Tested in iOS 8):
您可以通过在ABPeoplePickerNavigationContrller中使用以下代码来禁用UINavigationBar的半透明性来解决此问题(在iOS 8中测试):
_addressBookController = [[ABPeoplePickerNavigationController alloc] init];
[_addressBookController setPeoplePickerDelegate:self];
[[UINavigationBar appearanceWhenContainedIn:[ABPeoplePickerNavigationController class], nil] setTranslucent:NO];
[self presentViewController:_addressBookController animated:YES completion:nil];
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.