Я использую AlertView для создания экрана логина / пароля. У меня есть проблемы с форматированием представления. Я хочу, чтобы AlertView был таким же высоким (проверьте экран печати, если я не уверен), но я не знаю как!
Вот код, который я сделал:
// Ask for Username and password.
UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:@"Login et mot de passe" message:@"" delegate:self cancelButtonTitle:@"Annuler" otherButtonTitles:@"Sauvegarder", nil];
// Adds a username Field
textfieldName = [[UITextField alloc] initWithFrame:CGRectMake(12.0, 45.0, 260.0, 25.0)];
textfieldName.placeholder = @"Login";
[textfieldName setBackgroundColor:[UIColor whiteColor]];
textfieldName.enablesReturnKeyAutomatically = YES;
[textfieldName setReturnKeyType:UIReturnKeyDone];
[textfieldName setDelegate:self];
[alertView addSubview:textfieldName];
// Adds a username
textfieldPassword = [[UITextField alloc] initWithFrame:CGRectMake(12.0, 90.0, 260.0, 25.0)];
textfieldPassword.placeholder = @"Password";
[textfieldPassword setBackgroundColor:[UIColor whiteColor]];
textfieldPassword.enablesReturnKeyAutomatically = YES;
[textfieldPassword setReturnKeyType:UIReturnKeyDone];
[textfieldPassword setDelegate:self];
[alertView addSubview:textfieldPassword];
// Show alert on screen.
[alertView show];
[alertView release];
