我正在使用FPPopover为我的iPhone应用程序呈现弹出视图。然而,我有一个问题,当我展示它的时候,它只允许我把它展示得很低,否则它就会跳到最上面。这是在它被切断之前很好的。
例如:
[self.speedOptionsPopover presentPopoverFromPoint:CGPointMake(0, 235)];运行良好,但如果我将它设置为255而不是235 (因为它是从底部开始的一个很好的40px ),它会跳回到顶部。
有没有人对此有任何经验,或者我可以如何修复它?
另外,如果你能解释为什么弹出的内容总是从顶部开始像50px一样开始,当我想让它启动得更高时,加分。我怎样才能改变这一点?
更多来自创建的代码:
- (void)speedOptionsTapped:(UIBarButtonItem *)sender {
// Set the delegate in the controller that acts as the popover's view to be self so that the controls on the popover can manipulate the WPM and number of words shown
self.speedOptionsController.delegate = self;
self.speedOptionsPopover.arrowDirection = FPPopoverNoArrow;
self.speedOptionsPopover.border = NO;
self.speedOptionsPopover.contentSize = CGSizeMake(320, 190);
[self.speedOptionsPopover presentPopoverFromPoint:CGPointMake(0, 235)];
}发布于 2013-05-22 03:26:48
尝试替换FPPopoverController.m中的这部分代码:
//ok, will be vertical
if(ht == best_h || self.arrowDirection == FPPopoverArrowDirectionDown)使用以下代码:
//ok, will be vertical
if (self.arrowDirection == FPPopoverNoArrow)
{
r.origin.x = p.x;
r.origin.y = p.y;
}
else if(ht == best_h || self.arrowDirection == FPPopoverArrowDirectionDown)出现此问题的原因可能是宏FPPopoverArrowDirectionIsVertical将没有箭头的弹出窗口视为具有垂直箭头。因此,结果就是,它会试图使您的弹出窗口尽可能靠近触发弹出窗口的视图。
如果你像上面指出的那样替换代码,你将创建一个没有箭头的弹出窗口的特殊情况,并要求在不重新定位的情况下尊重原始点。
https://stackoverflow.com/questions/16513089
复制相似问题