ios – 如何添加UIActionSheet按钮复选标记?

ios – 如何添加UIActionSheet按钮复选标记?,第1张

概述我想知道如何在actionSheet按钮右侧添加复选标记最简单的方法? Bellow是Podcasts应用程序的屏幕截图. 最后我通过使用UIAlertController得到了答案: UIAlertController *customActionSheet = [UIAlertController alertControllerWithTitle:nil message:nil preferre 我想知道如何在actionSheet按钮右侧添加复选标记最简单的方法?
Bellow是podcasts应用程序的屏幕截图.

解决方法 最后我通过使用UIAlertController得到了答案:
UIAlertController *customActionSheet = [UIAlertController alertControllerWithTitle:nil message:nil preferredStyle:UIAlertControllerStyleActionSheet];UIAlertAction *firstbutton = [UIAlertAction actionWithTitle:@"First button" style:UIAlertActionStyleDefault handler:^(UIAlertAction * action) {    //click action}];[firstbutton setValue:[UIcolor blackcolor] forKey:@"TitleTextcolor"];[firstbutton setValue:[UIcolor blackcolor] forKey:@"imageTintcolor"];[firstbutton setValue:@true forKey:@"checked"];UIAlertAction *secondbutton = [UIAlertAction actionWithTitle:@"Second button" style:UIAlertActionStyleDefault handler:^(UIAlertAction * action) {    //click action}];[secondbutton setValue:[UIcolor blackcolor] forKey:@"TitleTextcolor"];UIAlertAction *cancelbutton = [UIAlertAction actionWithTitle:@"Cancel" style:UIAlertActionStyleCancel handler:^(UIAlertAction *action){    //cancel}];[cancelbutton setValue:[UIcolor blackcolor] forKey:@"TitleTextcolor"];[customActionSheet addAction:firstbutton];[customActionSheet addAction:secondbutton];[customActionSheet addAction:cancelbutton];[self presentVIEwController:customActionSheet animated:YES completion:nil];

这就是结果:

总结

以上是内存溢出为你收集整理的ios – 如何添加UIActionSheet按钮复选标记?全部内容,希望文章能够帮你解决ios – 如何添加UIActionSheet按钮复选标记?所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址:https://54852.com/web/1109191.html

(0)
打赏 微信扫一扫微信扫一扫 支付宝扫一扫支付宝扫一扫
上一篇 2022-05-29
下一篇2022-05-29

发表评论

登录后才能评论

评论列表(0条)

    保存