내 응용 프로그램은 매우 간단하고 splitview 컨트롤러를 사용하지 않습니다. 내 질문은 .. 어떻게 내 uBiew UIButton 클릭하면 popovercontroller보기에서 내 루트보기 컨트롤러를 통해로드 할 수 있습니다.UIButton의 rootUIView에 새로운 UIView로드 UIPopovercontroller에서
0
A
답변
0
팝업보기에서 버튼을 눌렀을 때 루트보기 컨트롤러가 먼저 팝업을 닫은 다음 루트보기 컨트롤러에서 새보기를 표시 할 수있게해야합니다.
popver 내부 버튼을 사용하여 popover의 해고하는 방법에 대한 자세한 내용은 이전 대답 "How to setup Popover views to dismiss properly"을 참조하십시오.
주요 아이디어는 : 당신이 그것에 대한 참조를 유지해야합니다
은 수동으로 팝 오버를 닫습니다. 좋은 장소는 popover를 보여주는보기 컨트롤러에있을 것입니다.
콘텐츠 뷰 컨트롤러 내부 버튼 대리자 + 프로토콜 또는 NSNotificationCenter가있는 팝 오버, 가능한 방법으로 두 를 해제합니다 ( 팝 오버를 표시) 원래 뷰 컨트롤러 말하게한다. 그 이전의 대답에
- (void)contentFooViewControllerDone:(NSNotification *)notification
{
// Button in content view controller was tapped, dismiss popover...
[self.popoverController dismissPopoverAnimated:YES];
// Load new view here...
// Note: If intending to use presentModalViewController
// (instead of addSubView), you might need to set animated to NO
// for above popover dismissal (otherwise presentModal will do nothing)
// or use performSelector:withObject:afterDelay to present new
// view controller to animate both dismiss and present.
}
0
[[NSNotificationCenter defaultCenter]
addObserver:self
selector:@selector(contentFooViewControllerDone:)
name:@"contentFooViewControllerDone"
object:popoverController.contentViewController];
- (void)contentFooViewControllerDone:(NSNotification *)notification
{
// Button in content view controller was tapped, dismiss popover...
[self.popoverController dismissPopoverAnimated:YES];
}
- (void)dealloc
{
//stop listening for notifications and release popoverController...
[[NSNotificationCenter defaultCenter] removeObserver:self];
[popoverController release];
[super dealloc];
}
- (IBAction)dismissButtonTapped
{
[[NSNotificationCenter defaultCenter]
postNotificationName:@"contentFooViewControllerDone" object:self];
}
관련 문제
- 1. 다른 NIB에서 UITableView로 UIView로드
- 2. UIButton의 애니메이션
- 3. UIButton의 세부 정보 표시
- 4. 아이폰 활성 창에 또 다른 UIView로드
- 5. UIPopOverController에서 편집 버튼을 사용하여 ABPersonViewController를 표시하는 방법
- 6. UIPopoverController에서 다른 UIView로 드래그 앤 드랍
- 7. UIButton의 제목 설정
- 8. UIButton의 텍스트 크기 변경
- 9. UITableView에서 UIButton의 선택된 상태
- 10. UIButton의 배경 이미지를 얻으십시오
- 11. UIButton의 개요 텍스트/글꼴
- 12. UIButton의 터치 가능 영역
- 13. 사용자 정의 UIButton의 불투명도
- 14. UIButton의 Subview가 해제되어야합니까?
- 15. UIButton의 코너 반경 문제
- 16. (n?) UIButton의 기존 작업을 어떻게 바꿉니 까?
- 17. 이미지 대 UIButton의 배경 이미지
- 18. UIButton의 여러 상태에 대한 setContentEdgeInsets?
- 19. UIButton의 touchUpInside 이벤트가 작동하지 않습니다.
- 20. 클릭하면 UIButton의 배경 이미지를 변경하는 방법?
- 21. 어떻게하면 UIPopOverController에서 버튼이 눌려 졌는지 UIViewController에 알릴 수 있습니까?
- 22. 여러 UIButton의 색상 배경을 만들 수 있습니까?
- 23. 단일 메서드 호출로 UIButton의 제목을 설정 하시겠습니까?
- 24. UIButton의 프레임을 UILabel의 특정 단어로 설정하십시오.
- 25. UIButton의 이미지를 임의로 이미지 배열로 설정합니다.
- 26. UIButton 이미지 앞에 UIButton의 제목을 설정하는 방법
- 27. 앱에서 UIButton의 알파 값을 저장하고로드하는 방법은 무엇입니까?
- 28. UIButton의 titleLabel.text가 Cocoa Touch에 표시되지 않습니다.
- 29. 특정 태그가있는 UIButton의 제목을 설정하는 방법은 무엇입니까?
- 30. UIScrollview에있는 UIButton의 이동이 느린 속도로 느려집니다.
,하지만 난 UIView의를로드하는 버튼 액션 코드가 필요합니다 :
귀하의 경우의 차이는 (당신이 당신의 루트 뷰 컨트롤러에 넣어 것)을 contentFooViewControllerDone 방법에있을 것입니다 내 rootViewController를 통해. – Meeya
루트보기 컨트롤러에서 팝 오버 컨트롤러를 표시하고 있습니까? 콘텐츠보기 컨트롤러에 버튼이 있습니까? IB로 또는 프로그래밍 방식으로 버튼을 만들었습니까? "버튼 액션 코드가 필요합니다"라고 묻는 질문을 잘 모릅니다. 지금까지 무엇을 얻었습니까? – Anna
@aBitObvious, yes correct .. 그리고 popover에는 인터페이스 빌더에서 생성 된 UIButton이 있습니다. 그리고 버튼을 클릭하면 새로운 루트보기를 통해 uiview를 열어야합니다. pushviewcontroller 코드를 실행하려고했습니다. 그러나 성공하지 못했습니다. – Meeya