2011-12-27 38 views
0

实际上,我需要移动UIpopovercontroller,虽然它是开放的,但我发现我们不能移动它,而它打开我们唯一能做的就是关闭它,然后再次打开它,但我再次发现一个问题,当我尝试驳回一个popover,然后再次打开它不会打开。请看看我的代码。IOS IPAD UIpopovercontroller需要关闭并打开相同的过程

CGRect cursor = [TextViewText menuPresentationRect]; 

    if ([PredictionPopover isPopoverVisible]) { 
     [PredictionPopover dismissPopoverAnimated:YES]; 
[PredictionPopover presentPopoverFromRect:CGRectMake(CGRectGetMidX(cursor), CGRectGetMaxY(cursor), 1, 1) inView:TextViewText permittedArrowDirections:UIPopoverArrowDirectionAny animated:YES]; 

    } else { 
     [PredictionPopover presentPopoverFromRect:CGRectMake(CGRectGetMidX(cursor), CGRectGetMaxY(cursor), 1, 1) inView:TextViewText permittedArrowDirections:UIPopoverArrowDirectionAny animated:YES]; 
    } 

有人可以告诉我我最近怎么了?

回答

0

解决了这个问题由刚刚停止动画

CGRect cursor = [TextViewText menuPresentationRect]; 

    if ([PredictionPopover isPopoverVisible]) { 
     [PredictionPopover dismissPopoverAnimated:NO]; 
[PredictionPopover presentPopoverFromRect:CGRectMake(CGRectGetMidX(cursor), CGRectGetMaxY(cursor), 1, 1) inView:TextViewText permittedArrowDirections:UIPopoverArrowDirectionAny animated:NO]; 

    } else { 
     [PredictionPopover presentPopoverFromRect:CGRectMake(CGRectGetMidX(cursor), CGRectGetMaxY(cursor), 1, 1) inView:TextViewText permittedArrowDirections:UIPopoverArrowDirectionAny animated:NO]; 
    }