다른보기에서 popover
이라는 UIPopoverController
이 있습니다. 내가 알고 싶은 것은, 현재 popover view에서 UIButton
을 눌렀다면 popover를 취소 할 수 있습니까? 미리 감사드립니다.다른보기에서 UIPopoverController 닫기
0
A
답변
1
NSNotification을 사용하면 다른보기에 팝업보기를 닫도록 지시 할 수 있습니다.
사용 예제는 :
// Add an observer that will respond to our notification.
[[NSNotificationCenter defaultCenter] addObserver:self // <- This is the object that will has the selector that we want to run (the same one we use in the next line).
selector:@selector(doSomething:) // <- This is the selector we want to run.
name:@"doSomethingNow" // <- This is notification name we will send to activate our observer's selector.
object:nil]; // Don't worry about this for now.
// Post the notification. This has the same name as our observer above, so our 'doSomething' selector should be run.
[[NSNotificationCenter defaultCenter] postNotificationName:@"doSomethingNow" object:nil];
// the function specified in the same class where we defined the addObserver
- (void)doSomething:(NSNotification *)pNotification {
NSLog(@"Received Notification...");
}
2
나는 항상 이상하게 UIViewController에 그것이 "contentSizeForViewInPopover"속성,하지만 UIPopoverController 자체에 대한 포인터를 유지하지 않습니다 통해이 팝 오버에 있어야 얼마나 큰 알고 있다는 것을 발견했다. 항상 추가 끝내기 :
@property (nonatomic,assign) UIPopoverController* popover;
내 UIViewController 클래스에 만들고 popover를 만들 때 설정합니다. 그런 다음 해당 UIViewController 아무것도에서 팝업을 닫으려면이 작업을 수행 할 수 있습니다.
[popover dismissPopoverAnimated:YES];
관련 문제
- 1. ipad - UIPopoverController 닫기
- 2. 콘텐츠 컨트롤러 내에서 iPad UIPopoverController 닫기
- 3. UIPopoverController Not Animating
- 4. UITableView가있는 UIPopoverController
- 5. UIPopOverController 문제
- 6. UIPopoverController placement
- 7. UIPopovercontroller 부모?
- 8. 다른보기에서 같은 클래스
- 9. 다른보기에서 다른보기의 내용에 액세스
- 10. 다른보기에서 변경하는 Android MapView
- 11. 다른보기에서 작업 완료를 기다립니다.
- 12. 다른보기에서 동영상 스트림 열기
- 13. 다른보기에서 테이블보기의 단추에 액세스
- 14. 다른보기에서 단추에 이미지 추가
- 15. 다른보기에서 테이블보기를 업데이트하는 방법
- 16. 아이 패드 UIPopoverController
- 17. UIPopoverController deallocated issue
- 18. 화살표 UIPegmentedControl의 UIPopoverController
- 19. UIPopoverController 앵커 위치
- 20. UIImagePickerController via UIPopoverController
- 21. UIPopoverController : 이동하는 방법?
- 22. UIPopoverController UIPopoverArrowDirection의 위치 변경
- 23. UIPopoverController 문제 탐색
- 24. UITableViewCell을 통한 UIPopoverController
- 25. UIPopoverController 대리인 문제?
- 26. 는 UIPopoverController 어떤 이유로
- 27. 상단의 UIPopoverController 툴바
- 28. UIPopoverController 메모리 질문
- 29. iPhone : MapView에 UIPopoverController 표시
- 30. 닫기 popover - Objective-c
나는 이것을위한 샘플 코드를 얻을 수 있습니까? – ishhhh
몇 가지 예제 코드를 추가했습니다. 궁금한 점이 있으면 알려주세요. – FreeAsInBeer
@Downvoter 왜 downvote? – FreeAsInBeer