다른 사용자 지정 경고보기의 배경 (밝은 회색 0.5 알파) 역할을하는보기가 있습니다.다른보기 컨트롤러의 하위보기 숨기기
사용자가 사용자 지정 경고에서 확인 단추를 누르면 사용자 지정 경고와 배경보기도 숨기려고합니다.
두 견해가 같은 슈퍼 뷰의 서브 뷰입니다 ...
I의 의견을 숨길 수있는 buttonTapped:
방법에서이 작업을 수행하고, 첫 번째 시도를 위해 작동하지만 이후 두 번째에서, 배경 뷰 결코 닫으십시오 ... 경고는 매번 정확하게 숨 깁니다.
[UIView animateWithDuration:0.5f animations:^{
self.view.alpha=0.0f; //hide alert
[self.view.superview viewWithTag:1].alpha=0.0f; //hide background
}];
다음과 같이 그들은, 파단로 추가됩니다 :
ResultDialogController *dialogController = [[[ResultDialogController alloc] initWithNibName:@"ResultDialogController_" bundle:nil] retain];
ResultBackgroundViewController *bgViewController = [[[ResultBackgroundViewController alloc] initWithNibName:@"ResultView" bundle:nil] retain];
dialogController.view.alpha=0;
bgViewController.view.alpha=0;
bgViewController.view.tag=1;
[UIView animateWithDuration:0.5f animations:^{
bgViewController.view.alpha=0.5f;
dialogController.view.alpha=1.0f;
}];
[self.view addSubview:bgViewController.view];
[self.view addSubview:dialogController.view];
[dialogController release];
[bgViewController release];
어떻게 내가 항상 배경보기를 기각 할 수 있습니까? 당신의 의견에 대한 HIDE 속성을 설정하여 숨길 수 있습니다
감사
감사합니다. 두 장의 편집이 있습니다. 'animateWithDuration : 0.5f' 다음에는'duration '이라는 단어가 없어야합니다. 또한 완료 블록 핸들러는'completion :^(BOOL finished) {' – joec
입니다. 희망이 도움이됩니다. 그리고 업데이트 된 게시물. –