2011-03-24 5 views
1

특정 지점의 화살표가있는 준비된 Popover (TableView 내부)를 표시하는 방법은 무엇입니까? 기본적으로 CGPoint screenPointContainer가 있으며 거기에 내 popover를 보여주고 싶습니다. 직사각형, 버튼 없음. 단일 지점.CGPoint에서 Popover

detailsPop.popoverContentSize = CGSizeMake(250, 300); 
CGRect myrect = CGRectMake(screenPointContainer.x, screenPointContainer.y, ??, ??); 
[detailsPop presentPopoverFromRect:myrect inView:self.view permittedArrowDirections:UIPopoverArrowDirectionAny animated:YES]; 

답변

1

그 좌표 왜곡의 이유를 찾을 수 있습니다 (60 개 단위 위)와 수동 방향 검사를 포함하여 좌표를 편집했다하지 않았다. 직사각형의 H와 W는 모두 0 지금이 OK 인있다 :이 경우

if ([[UIDevice currentDevice] orientation] == UIDeviceOrientationLandscapeLeft || [[UIDevice currentDevice] orientation] == UIDeviceOrientationLandscapeRight) 
{ 

     CGRect myrect2 = CGRectMake(screenPointContainer.x+320, screenPointContainer.y+60, 0, 0); 
     [detailsPop presentPopoverFromRect:myrect2 inView:self.view permittedArrowDirections:UIPopoverArrowDirectionAny animated:YES]; 

} else { 

     CGRect myrect2 = CGRectMake(screenPointContainer.x, screenPointContainer.y+60, 0, 0); 
     [detailsPop presentPopoverFromRect:myrect2 inView:self.view permittedArrowDirections:UIPopoverArrowDirectionAny animated:YES]; 
} 
3

당신은 단지 1 픽셀 크기의 CGRect를 만들 수 있습니까? 기본적으로 포인트가 될 것이다 :

CGRect myRect = CGRectMake(screenPointContainer.x, screenPointContainer.y, 1, 1);

+0

가 팝 오버가 클릭의 실제 온도보다 더 높은 스폰. – Razp

관련 문제