Проблема-Мне нужен UIAlertView, который содержит заголовок, два текстовых поля с заполнителями и две кнопки. То, что я делал до сих пор-Я использовал этот код, я получаю точный UIAlertView со всем тем, что я упомянул, но когда представление загружается, кажется, что оно сначала появляется внизу, а затем переходит в середина вида.
-(void)showalert{
disclaimerAgreedAlertView = [[UIAlertView alloc] initWithTitle:@" "
message:@" "
delegate:self
cancelButtonTitle:@"Cancel"
otherButtonTitles:@"Login", nil];
userNameTextField = [[UITextField alloc] initWithFrame:CGRectMake(20.0, 15.0, 245.0, 25.0)];
userNameTextField.delegate=self;
[userNameTextField setBackgroundColor:[UIColor whiteColor]];
[userNameTextField setKeyboardType:UIKeyboardTypeDefault];
userNameTextField.placeholder=@"Username";
userNameTextField.secureTextEntry=NO;
[disclaimerAgreedAlertView addSubview:userNameTextField];
passwordTextField = [[UITextField alloc] initWithFrame:CGRectMake(20.0, 45.0, 245.0, 25.0)];
passwordTextField.delegate=self;
[passwordTextField setBackgroundColor:[UIColor whiteColor]];
[passwordTextField setKeyboardType:UIKeyboardTypeDefault];
passwordTextField.placeholder=@"Password";
passwordTextField.secureTextEntry=YES;
[disclaimerAgreedAlertView addSubview:passwordTextField];
disclaimerAgreedAlertView.tag=99;
[disclaimerAgreedAlertView show];
disclaimerAgreedAlertView.frame= CGRectMake(5, 400, 320, 160);
}
Затем я попробовал некоторые из недокументированных API, которые дают мне желаемый результат, но я боюсь, что это может привести к отклонению моего приложения.
Итак, есть какие-нибудь решения?