UIAlertView cancelButtonTitle

5

除了使用构造函数 initWithTitle:message:delegate:cancelButtonTitle:otherButtonTitles: 之外,有没有一种方法可以为 UIAlertView 的取消按钮设置标题。如果我先前已经初始化了 UIAlertView,并且在稍后的时间点想要更改取消按钮的标题,该怎么办。

1个回答

11

我不知道如何在以后更改取消按钮的文本(我没有看到任何删除/编辑按钮的方法),但如果您一开始没有指定取消按钮,您可以稍后添加它,并使用您想要的任何标签。

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

而且其他按钮参数相当于:[alertView addButtonWithTitle:@"Cancel"] - Evils

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接