我需要在UIAlertview中放置3个按钮和一个文本框。我写这样的代码。显示带文本框和按钮的UIAlertview时出现问题
UIAlertView *share = [[UIAlertView alloc] initWithTitle:@"Refresh" message:nil delegate:self cancelButtonTitle:@"Cancel" otherButtonTitles:@"OK", @"Contacts", nil];
share.tag = 2;
[share setDelegate:self];
[share setTitle:@"Enter Name"];
[share setMessage:@" "];
nameField = [[UITextField alloc] initWithFrame:CGRectMake(20.0, 45.0, 245.0, 25.0)];
[nameField setBackgroundColor:[UIColor whiteColor]];
[nameField setKeyboardType:UIKeyboardTypePhonePad];
[share addSubview:nameField];
[share show];
[share release];
[nameField release];
但它显示like this。
如果我放置2个按钮,它显示正常。
当我添加新按钮它添加在下一行显示上面的链接。
但我需要在一列中显示所有三个按钮。
我该怎么做?
我试图通过放置消息零但没有改变。我需要在一个列中水平排列按钮,而不是垂直排列......你可以编辑你的答案。 – MaheshBabu 2011-01-10 05:07:47