gpt4 book ai didi

iphone - UIAlertView 没有取消按钮?

转载 作者:行者123 更新时间:2023-12-03 18:41:55 26 4
gpt4 key购买 nike

我正在尝试创建一个具有 3 个选项且没有“取消”按钮的 UIAlertView,但是当我这样做时,它总是将“按钮 3”样式设置为取消按钮。有什么办法可以避免这种情况吗?

UIAlertView *alertView= [[UIAlertView alloc] initWithTitle:@"Select One" message:nil delegate:self cancelButtonTitle:nil otherButtonTitles:@"Button 1",@"Button 2", @"Button3", nil];

最佳答案

我的做法不同,将 cancelButtonTitle 参数传递为 nil

UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Title"
message:@"Message here"
delegate:self
cancelButtonTitle:nil
otherButtonTitles:@"OK", nil];

关于iphone - UIAlertView 没有取消按钮?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7250360/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com