简体   繁体   English

如何在UIActionsheet的按钮上添加复选标记,我可以在iphone中创建刻度标签?

[英]how to add checkmark on UIActionsheet's buttons where i can create tick label in iphone?

I am trying to figure out how to add a checkmark to the right side of a button in a UIActionSheet. 我试图找出如何在UIActionSheet中的按钮右侧添加复选标记。 Is there a safe way to add this checkmark in UIActionSheet's Button? 有没有一种安全的方法可以在UIActionSheet的Button中添加这个复选标记? is there any simpler way to do add checkmark in UIActionsheet's buttons without using Of Private api ? 有没有更简单的方法在UIActionsheet的按钮中添加复选标记而不使用Of Private api?

From iOS 8.0 you can use UIAlertController . 从iOS 8.0开始,您可以使用UIAlertController In UIAlertController , each button item is know as UIAlertAction which add accordingly. UIAlertController ,每个按钮项都被称为UIAlertAction,相应地添加。 UIAlertAction contains a runtime property called image which you can set as per your need. UIAlertAction包含一个名为image的运行时属性,您可以根据需要进行设置。

 UIAlertAction *SwipeView =[UIAlertAction actionWithTitle:@"Swipe View" style:UIAlertActionStyleDefault handler:^(UIAlertAction *action) {


}];
[SwipeView setValue:[UIImage imageNamed:@"tick_mark" ] forKey:@"_image"];

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM