objective-c - UIAlertView cancelButtonTitle

标签 objective-c ios uialertview

除了它的构造函数 initWithTitle:message:delegate:cancelButtonTitle:otherButtonTitles: 之外,有没有办法为 UIAlertView 的取消按钮设置标题。如果我之前和之后初始化了 UIAlertView,我想更改取消按钮的标题。

最佳答案

我不知道稍后更改取消按钮文本(我没有看到任何删除/编辑按钮方法),但如果您没有预先指定取消按钮,则可以稍后添加,带有您想要的任何标签,例如

[action setCancelButtonIndex:[action addButtonWithTitle:@"Cancel"]];

关于objective-c - UIAlertView cancelButtonTitle,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10168300/

相关文章:

objective-c - 将登录 ViewController 放在 Storyboard 中的什么位置?

ios - 如何一次将事件从外滚动传递到内滚动

objective-c - 同一类的不同实例之间共享属性

iphone - IOS 文件选择器

ios UIAlertView : make alert wait for my response

ios - xcode ios opencv 内存泄漏。应用程序崩溃

ios - 直播应用 iOS

ios - 自定义编辑菜单中 UIMenuItems 的顺序

ios - Urban Airship 未在应用程序中显示警报

ios - 用户界面自动化 : Cancel button on Alert view is tapped without actually doing it