2010-02-02 2 views
2

iPhone의 캘린더 앱에서 '일정 삭제'버튼을 누르면 확인 메시지가 하단에서부터 슬라이드됩니다. 누구든지 이것에 대한 예제 코드를 알고 있습니까, 아니면 그냥 사용자 정의 배경으로 모달로 제공되는 짧은보기입니까?iPhone에서 멀티 버튼 확인을 어떻게 만듭니 까?

사용자 정의보기를 사용하여 만든 경우 캘린더 응용 프로그램에서 사용한 것과 동일한 배경 그래픽을 어디서 얻을 수 있습니까?

미리 감사드립니다.

NB : UIAlertView 대화 상자에 대해 말하는 것이 아니라 여러 개의 단추가있는 슬라이드 인 확인입니다.

답변

7

UIActionSheet가 당신이 찾고있는 것입니다. 이 바닥에서 작업 시트에 미끄러

UIActionSheet *actionSheet = [[UIActionSheet alloc] initWithTitle:@"Save photo?" delegate:self cancelButtonTitle:@"No" destructiveButtonTitle:@"Yes" otherButtonTitles:nil]; 
[actionSheet showInView:self.view]; 
[actionSheet release]; 

: 여기

은 당신이 시작하는 몇 가지 코드 예제입니다. 그것은 2 개의 버튼이 있습니다. 예 및 아니요

사용자가 어떤 버튼을 선택

actionSheet:didDismissWithButtonIndex: 방법은

-(void) actionSheet:(UIActionSheet *)actionSheet didDismissWithButtonIndex:(NSInteger)buttonIndex{ 
//your code here 
} 

호출되는 컨트롤러 클래스는 < UIActionSheetDelegate> 프로토콜이 도움이

희망을 가입해야합니다!

+0

멋진 답변, 빠른 답변 감사드립니다. Action Sheets가 iPad에서만 사용되었다고 생각했습니다. – pchap10k

1
UIActionSheet *actionSheet = [[UIActionSheet alloc] initWithTitle:@"title" delegate:self cancelButtonTitle:@"cancel" destructiveButtonTitle:@"destructive" otherButtonTitles:@"other", nil]; 
[actionSheet showInView:self.view]; 
[actionSheet release];