2011-02-16 4 views

답변

1

다음 코드를 시도하려고 :

UIAlertView alertView = [[UIAlertView alloc] initWithTitle:NSLocalizedString(@"Title", nil) 
                message:NSLocalizedString(@"Message\n\n\n", nil) 
               delegate:self 
             cancelButtonTitle:NSLocalizedString(@"Cancel", nil) 
             otherButtonTitles:NSLocalizedString(@"OK", nil), nil]; 

    UITextField textField = [[UITextField alloc] initWithFrame:CGRectMake(16.0, 100.0, 250.0, 25.0)]; 
    textField.borderStyle = UITextBorderStyleRoundedRect; 

    [alertView addSubview:textField]; 
    [textField release]; 
    [alertView show]; 
    [alertView release]; 
+0

감사합니다. 그것의 작동 .. 사실 나는 같은 방식으로하고 있지만 "\ n \ n \ n"을 사용하지는 않습니다. 텍스트 상자가 버튼과 겹치는 이유가 무엇인지. –

0

UITextField *TextField = [[UITextField alloc] initWithFrame:CGRectMake(22.0, 50.0, 240.0, 30.0)]; 

UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:@"Enter\n\n" message:@"" delegate:self cancelButtonTitle:@"Ok" otherButtonTitles:nil]; 
[alertView addSubview:TextField]; 
[alertView show]; 
+0

감사합니다 도움이 될 것입니다! 그것의 작동 .. 사실 나는 같은 방식으로하고 있지만 "\ n \ n \ n"을 사용하지는 않습니다. 텍스트 상자가 버튼과 겹치는 이유가 무엇인지. –

관련 문제