2011-12-22 21 views
0

聖誕快樂。問題在uitableview中使用wepopover

我有一個視圖,其中包含一個uitableview。 Iam使用wepopover來顯示其中一個表格單元格被選中時的附加信息。然而,我的問題是選擇某些單元格時,彈出窗口的一部分顯示在視圖外並且不可見。內容大小設置正確,原點也是正確的。

,用於將酥料餅我這樣做,其中幀的UITableView單元的幀速

detailedInfoView=[[ScheduleDetailedInformation alloc] initWithNibName:@"ScheduleDetailedInformation" bundle:nil]; 

     detailedInfoView.contentSizeForViewInPopover = detailedInfoView.view.frame.size;  

     navPopover = [[WEPopoverController alloc] initWithContentViewController:detailedInfoView]; 

     [navPopover presentPopoverFromRect:frame 
            inView:self.tableview 
        permittedArrowDirections:UIPopoverArrowDirectionUp | UIPopoverArrowDirectionDown|UIPopoverArrowDirectionLeft|UIPopoverArrowDirectionAny 
            animated:YES]; 

誰能可能會告訴我什麼,我都忘記了,或者一個解決方法嗎?

Thanx

回答

0

不幸的是,沒有人向我提供了一個黃金答案。但是我自己解決了這個問題。在添加popover視圖之前,我將它添加到uitableview,但是這首先造成了問題。相反,我將它添加到父視圖中,但是這給了一些定位錯誤,我用下面的代碼行解決了這個問題 - 它將uitableviewcell的位置轉換爲父視圖中的位置。

CGPoint tmp= [[tableView cellForRowAtIndexPath:indexPath].superview convertPoint:[tableView cellForRowAtIndexPath:indexPath].frame.origin toView:nil]; 

CGRect frame = CGRectMake(tmp.x, tmp.y-(CGRectCell.size.height/2), CGRectCell.size.width, CGRectCell.size.height); 

希望這可以幫助別人:)