Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/xcode/7.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Iphone 获取CGPoint与应用程序窗口的比较_Iphone_Xcode_Uiimageview - Fatal编程技术网

Iphone 获取CGPoint与应用程序窗口的比较

Iphone 获取CGPoint与应用程序窗口的比较,iphone,xcode,uiimageview,Iphone,Xcode,Uiimageview,我有一个桌面视图。我想找到appDelegates窗口的UIImageView的中心 MA_MobileAppDelegate *appDelegate = (MA_MobileAppDelegate *)[[UIApplication sharedApplication] delegate]; UAModalPanel *modalPanel = [[MSPicturePreview alloc] initWithFrame:appDelegate.window.fr

我有一个桌面视图。我想找到appDelegates窗口的UIImageView的中心

MA_MobileAppDelegate *appDelegate = (MA_MobileAppDelegate *)[[UIApplication sharedApplication] delegate];

            UAModalPanel *modalPanel = [[MSPicturePreview alloc] initWithFrame:appDelegate.window.frame withimage:self.customImageView.image];

            [appDelegate.window addSubview:modalPanel];

            [modalPanel showFromPoint:[appDelegate.window.superview convertPoint:[self.customImageView center] toView:nil]];

下面的代码在左上角指出了这一点。有没有办法获得窗口上图像的实际点?

试试这样。我想它会起作用的

[modalPanel showFromPoint:[self.view convertPoint:[self.customImageView center] toView:appDelegate.window.superview];
我用过这个

[modalPanel showFromPoint:[self.contentView convertPoint:[self.customImageView center] toView:appDelegate.window]];
基本上,我使用cells contentView转换appDelegates窗口的点