2013-04-23 1 views
0

어떻게 uiaertheet를 uialertview에 추가 할 수 있습니까 ??? 가 나는 또한 alertview에있는 tableview를 추가하고 또한 내가이 코드를 썼을 때 네 개의 버튼 을 가지고있는 actionsheet을 추가 할하고 그 오류를UIAlertView에 UIA 시트 추가하기

UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Preferences" 
                message:@"\n\n\n\n\n\n\n" 
                delegate:self 
              cancelButtonTitle:@"Cancel" 
              otherButtonTitles:@"OK", nil]; 

    UITableView *myView = [[[UITableView alloc] initWithFrame:CGRectMake(10, 40, 264, 150) 
                 style:UITableViewStylePlain] autorelease]; 
    myView.delegate = self; 
    myView.dataSource = self; 



    [alert addSubview:myView]; 

    NSString *actionSheetTitle = @"Action Sheet Demo"; //Action Sheet Title 
    NSString *destructiveTitle = @"Destructive Button"; //Action Sheet Button Titles 
    NSString *other1 = @"Other Button 1"; 
    NSString *other2 = @"Other Button 2"; 
    NSString *other3 = @"Other Button 3"; 
    NSString *cancelTitle = @"Cancel Button"; 


    UIActionSheet *actionSheet = [[UIActionSheet alloc] initWithTitle:actionSheetTitle 
                  delegate:self 
                cancelButtonTitle:cancelTitle 
               destructiveButtonTitle:destructiveTitle 
                otherButtonTitles:other1, other2, other3, nil]; 

    UIView *tempView = [[UIView alloc] initWithFrame:CGRectMake(10, 250, alert.frame.size.width, 250)]; 
    tempView.backgroundColor = [UIColor redColor]; 
    tempView.clipsToBounds = YES; 
    [alert addSubview:tempView]; 

    [alert addSubview:actionSheet]; 
    [alert show]; 
    [actionSheet showInView:tempView]; 
    [myView reloadData]; 

있는 tableview이 완전히 추가하지만 actionsheet는 추가하지 않습니다를 제공합니다. 사용할 수있는 솔루션이 있습니까? 사전

답변

1

에서

덕분에 내가 경고를 사용하여 단순히 경고가 특정 목적을 가지고 있기 때문에 당신이 원하는 것을 표시 화면에보기 애니메이션을하지 않는 것이 좋습니다 것입니다. 그것은 소리보다 훨씬 쉽습니다.

2

오래된 질문,하지만 난 스택 오버플로 당신의 기여에 감사를 구글을 통해 여기

+0

환영을 받고 누군가를 위해 CXAlertView을 추천 할 것입니다. 외부 리소스에 대한 링크가 도움이 될 수 있지만 실제 응답을 구성하려면 종종 상황을 필요로합니다. [답변]을 참조하십시오. 특히 ** 링크에 대한 컨텍스트 제공 **을 참조하십시오. 이 경우 OP가 자신의 문제를 해결하는 데 어떻게 이것을 사용하는지 설명하십시오. – jerry