本文介绍了如何在UIActionsheet的按钮上添加复选标记,以便在iPhone中创建刻度标签?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图弄清楚如何在UIActionSheet中的按钮的右侧添加对勾.有没有一种安全的方法可以在UIActionSheet的Button中添加此复选标记?有没有更简单的方法可以在不使用Of Private api的情况下在UIActionsheet的按钮中添加选中标记?

I am trying to figure out how to add a checkmark to the right side of a button in a UIActionSheet.Is there a safe way to add this checkmark in UIActionSheet's Button?is there any simpler way to do add checkmark in UIActionsheet's buttons without using Of Private api ?

推荐答案

在iOS 8.0中,您可以使用 UIAlertController .在 UIAlertController 中,每个按钮项都称为UIAlertAction,并相应添加.UIAlertAction包含一个名为image的运行时属性,您可以根据需要进行设置.

From iOS 8.0 you can use UIAlertController. In UIAlertController, each button item is know as UIAlertAction which add accordingly. UIAlertAction contains a runtime property called image which you can set as per your need.

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


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

这篇关于如何在UIActionsheet的按钮上添加复选标记,以便在iPhone中创建刻度标签?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-20 12:13