imagePicker.sourceType = [imagePicker setAllowsEditing:NO];
imagePicker.delegate = self;
UINavigationBar *bar = imagePicker.navigationBar;
[bar setTintColor:HEXCOLOR(0x444444)];```
if (UI_USER_INTERFACE_IDIOM()==UIUserInterfaceIdiomPad) {
//iPad 版本代码;
UIPopoverController * popover = [[UIPopoverController alloc]initWithContentViewController:imagePicker];
[popover presentPopoverFromRect:CGRectMake(0, 0,self.width, 400) inView:self permittedArrowDirections:UIPopoverArrowDirectionAny animated:YES];
}
else {
//iPhone/iPod touch 版本代码;
[self.viewController presentViewController:imagePicker animated:YES completion:NULL];
}
网友评论