2011-12-27 39 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]; 
    }