if (UI_USER_INTERFACE_IDIOM()==UIUserInterfaceIdiomPad) {//判断 是否是ipad
UIPopoverPresentationController *popPresenter = [alertVc
popoverPresentationController];//为alertVc建立一个挂靠点
popPresenter.sourceView = goodsCell;//挂靠点
popPresenter.backgroundColor = [UIColor whiteColor];//避免点击时 另外的是黑框
popPresenter.sourceRect = goodsCell.contentView.bounds;//显示的大小
[self presentViewController:alertVc animated:YES completion:nil];
}
else
[self presentViewController:alertVc animated:YES completion:nil];
网友评论