我正在尝试使用三个按钮(将被堆叠)创建一个 UIAlertView。我希望取消按钮位于其他两个按钮之间的中间。我尝试将 cancelButtonIndex 设置为 1,但如果还有其他两个按钮,它只会将它们放在索引 0 和 1 处。我知道我可以更改按钮的名称,但我想要取消按钮的深蓝色格式.
编辑:**请注意 - 我知道如何以正确的顺序获取标题的三个按钮,但前提是所有三个按钮本质上看起来都像“其他”按钮;我希望取消按钮具有深蓝色背景的取消按钮,以便它看起来像一个常规的取消按钮。**
我试过了
UIAlertView *alert = [[[UIAlertView alloc] initWithTitle:title message:msg delegate:self cancelButtonTitle:@"Cancel" otherButtonTitles:button1Title,button2Title,nil] autorelease];
alert.cancelButtonIndex = 1;
[alert show];
和
UIAlertView *alert = [[[UIAlertView alloc] initWithTitle:title message:msg delegate:self cancelButtonTitle:@"Cancel" otherButtonTitles:nil] autorelease];
alert.cancelButtonIndex = 1;
[alert addButtonWithTitle:button1Title];
[alert addButtonWithTitle:button2Title];
[alert show];
和
UIAlertView *alert = [[[UIAlertView alloc] initWithTitle:title message:msg delegate:self cancelButtonTitle:@"Cancel" otherButtonTitles:addButtonWithTitle:button1Title,nil] autorelease];
alert.cancelButtonIndex = 1;
[alert addButtonWithTitle:button2Title];
[alert show];
无济于事。甚至有可能完成我想做的事情吗?