1

我有一个表格视图。我想为 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]];

下面的代码指出了左上角的点。有什么方法可以在窗口上获取图像的实际点?

4

2 回答 2

0

像这样试试。我认为它会起作用。

[modalPanel showFromPoint:[self.view convertPoint:[self.customImageView center] toView:appDelegate.window.superview];
于 2012-06-15T13:35:10.867 回答
0

我用这个

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

基本上我使用单元格 contentView 来转换 appDelegates 窗口的点......

于 2012-06-15T13:37:40.897 回答