UIPopoverController *popViewController = [[UIPopoverController alloc] initWithContentViewController:exchange_ViewController];
popViewController.contentViewController.view.backgroundColor = [UIColor whiteColor];
[popViewController setPopoverContentSize:CGSizeMake(400, 430) animated:YES];
popViewController.delegate = self;
[popViewController presentPopoverFromRect:CGRectMake(312, 95, 400, 430) inView:detailImageView permittedArrowDirections:0 animated:YES];
取消箭头
permittedArrowDirections:0
代理方法
- (void)popoverControllerDidDismissPopover:(UIPopoverController *)popoverController
{
[popViewController release];
}
// we finished rotating, if a popover is allocated, show it again in the new orientation
//popoverRect的中心点是用来画箭头的,如果中心点如果出了屏幕,系统会优化到窗口边缘
[self.popoverControllerpresentPopoverFromRect:savedPopoverRect
inView:self.view//上面的矩形坐标是以这个view为参考的
permittedArrowDirections:UIPopoverArrowDirectionAny//箭头方向
animated:YES];
网友评论