2012-09-17 2 views
0

popover를 삽입 할 수 있었지만 popover가 UISlider를 따르지 못했습니다 .. 슬라이더의 오른쪽 하단에 표시됩니다. 내가 뭘 잘못하고 있습니까? 어떻게 수정해야합니까? 사전에 부탁드립니다.popOver 슬라이더를 따르지 않습니다 -iOS/Xcode

percentView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 41, 33)]; 

UIImageView *percentImageView = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, 41, 33)]; 
[percentImageView setImage:[UIImage imageNamed:@"ipad-progress-value.png"]]; 
[percentView addSubview:percentImageView]; 

UILabel *percentLabel = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, 41, 26)]; 
[percentLabel setTag:1]; 
[percentLabel setText:@"m"]; 
[percentLabel setBackgroundColor:[UIColor clearColor]]; 
[percentLabel setTextColor:[UIColor whiteColor]]; 
[percentLabel setFont:[UIFont boldSystemFontOfSize:13]]; 
[percentLabel setTextAlignment:UITextAlignmentCenter]; 
[percentLabel setAdjustsFontSizeToFitWidth:YES]; 
[percentView addSubview:percentLabel]; 

[_slider addSubview:percentView]; 

답변

1

설명서에있는 설명에 따르면 슬라이더 다음에 팝업이 나타날 것이라고 나와 있지 않습니다. popover를 사용자가 지정한 버튼 옆에 두는 것은 보통 사용자가 버튼을 터치하여 popover가 실행되기 때문에 편리합니다.

일반적으로 팝 오버는 아무 것도 따르지 않거나 이동하지 않습니다.

슬라이더 컨트롤의 위치를 ​​알고 있다면 당신은 슬라이더의 RECT를 제공하는 다음과 같은

- (void)presentPopoverFromRect:(CGRect)rect inView:(UIView *)view permittedArrowDirections:(UIPopoverArrowDirection)arrowDirections animated:(BOOL)animated 

를 사용할 수 있습니다.

표시되는 동안 popover를 이동하고 싶다면 문제가있을 것이라고 생각하지만 UIView 애니메이션 코드를보고 UIPopover를 서브 클래 싱하여 직접 그려 봅니다.

관련 문제