首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 平面设计 > 图形图像 >

iPad上调用UIImagePickerViewController,与iPhone调用略有不同

2012-08-09 
iPad上调用UIImagePickerViewController,与iPhone调用略有不同。-(void) pickImage{UIImagePickerControlle

iPad上调用UIImagePickerViewController,与iPhone调用略有不同。

-(void) pickImage{    UIImagePickerController *m_imagePicker = [[UIImagePickerController alloc] init];    if ([UIImagePickerController isSourceTypeAvailable:UIImagePickerControllerSourceTypePhotoLibrary]) {        m_imagePicker.sourceType = UIImagePickerControllerSourceTypePhotoLibrary;        m_imagePicker.delegate = self;        [m_imagePicker setAllowsEditing:NO];        UIPopoverController *popover = [[UIPopoverController alloc] initWithContentViewController:m_imagePicker];        self.popoverController = popover;                [popoverController presentPopoverFromRect:CGRectMake(0, 0, 300, 300) inView:self.view permittedArrowDirections:UIPopoverArrowDirectionAny animated:YES];        [popover release];        [m_imagePicker release];    }else {        UIAlertView *alert = [[UIAlertView alloc]initWithTitle:nil message:@"Error accessing photo library!" delegate:nil cancelButtonTitle:@"Close" otherButtonTitles:nil];        [alert show];        [alert release];    }}

热点排行