문제

I have a UIPickerController that appears when you click a button though the arrow on it doesn't change position from the bottom even when I use UIPopoverArrowDirectionUp.

- (IBAction)addPicture:(id)sender {
    CGRect rect = CGRectMake(0,650,768,1024);
    [popOverController presentPopoverFromRect:rect inView:self.view permittedArrowDirections:UIPopoverArrowDirectionUp animated:YES];
}

I guess this must be quite common

Thanks in advance

도움이 되었습니까?

해결책

You are sending a rect that has as width 768 and height 1024 starting on 0 and 650, so its a huge element that is causing this unexpected behaviour. You should send as rect the rect of the button the user is pressing. Try this way instead.

- (IBAction)addPicture:(id)sender {
    [popOverController presentPopoverFromRect:[sender frame] inView:self.view permittedArrowDirections:UIPopoverArrowDirectionUp animated:YES];
}
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top