滚动视图中的弹出窗口
在我的 iPad 应用程序中,我在滚动视图中使用带有箭头的弹出框。它工作正常,但是当我滚动视图,然后点击按钮时,带有箭头的弹出窗口不会跟随按钮,它会在其原始位置打开。
我使用这段代码:
(void)showHomePopupAction:(id)sender {
self.popHome = [[[PopHome alloc] initWithNibName:@"PopHome" bundle:[NSBundle mainBundle]] autorelease];
popHome.contentSizeForViewInPopover = CGSizeMake(popHome.view.frame.size.width, popHome.view.frame.size.height);
self.popoverController = [[[UIPopoverController alloc] initWithContentViewController:popHome] autorelease];
[self.popoverController presentPopoverFromRect:popoverButtonForHome.frame inView:self.view permittedArrowDirections:UIPopoverArrowDirectionUp animated:YES];
}
您有任何想法或建议来解决这个问题吗? 谢谢!
In my iPad App, I use a popover with an arrow on a button in a scroll view. It works fine but when I scroll the view, then tap on the button, the popover with the arrow doesn't follow the buttom, it opens at its original position.
I use this code:
(void)showHomePopupAction:(id)sender {
self.popHome = [[[PopHome alloc] initWithNibName:@"PopHome" bundle:[NSBundle mainBundle]] autorelease];
popHome.contentSizeForViewInPopover = CGSizeMake(popHome.view.frame.size.width, popHome.view.frame.size.height);
self.popoverController = [[[UIPopoverController alloc] initWithContentViewController:popHome] autorelease];
[self.popoverController presentPopoverFromRect:popoverButtonForHome.frame inView:self.view permittedArrowDirections:UIPopoverArrowDirectionUp animated:YES];
}
Do you have any idea or suggestion to fix this problem?
Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
嘿,尝试这样的事情:
我只需要完全相同的...代码适用于 uiscrollview 中的 uibutton。
Hey, try something like this:
I just needed exactely the same ... the code works for my uibutton in a uiscrollview.