我自定义UIAlertView
并添加UITextView
和UITextfield
,但我需要设置按钮(我在标准init
中添加按钮)到{{1}的底部查看。在UIAlertView
init
我添加消息UIAlertView
时,这会给我5个字符串,但当我添加另一个@"\n\n\n\n\n"
时,会显示它的标准文本视图。
看看图像,让我更清楚地了解我拥有什么和我需要什么。
答案 0 :(得分:0)
使用此示例....
// Create Alert
UIAlertView* av = [UIAlertView new];
av.title = @"Find";
// Add Buttons
[av addButtonWithTitle:@"Cancel"];
[av addButtonWithTitle:@"Find & Bring"];
[av addButtonWithTitle:@"Find & Go"];
[av addButtonWithTitle:@"Go to Next"];
// Make Space for Text View
av.message = @"\n";
// Have Alert View create its view heirarchy, set its frame and begin bounce animation
[av show];
// Adjust the frame
CGRect frame = av.frame;
frame.origin.y -= 100.0f;
av.frame = frame;
// Add Text Field
UITextField* text = [[UITextField alloc] initWithFrame:CGRectMake(20.0, 45.0, 245.0, 25.0)];
text.borderStyle = UITextBorderStyleRoundedRect;
[av addSubview:text];
[text becomeFirstResponder];