我需要在UIActionSheet中标记选中的按钮。
如何在UIActionSheet按钮中添加复选标记?
有没有一些特定于UIActionSheet的方法,没有标准的在按钮内添加图像。
发布于 2014-11-21 16:21:40
otherButtonTitles:@"√ 1", @" 2", 发布于 2016-01-13 15:48:14
从iOS 8.0开始,您可以使用UIAlertController。在UIAlertController中,每个按钮项被称为UIAlertAction,它相应地添加。UIAlertAction包含一个名为image的运行时属性,您可以根据需要进行设置。
UIAlertActioin *action1 = [UIAlertAction actionWithTitle:@"1" style: UIAlertActionStyleDefault handler:(void (^)(UIAlertAction *action)) {
[action setValue:[UIImage imageNamed:@"your-image-name"] forKey:@"_image"];
}];https://stackoverflow.com/questions/26996781
复制相似问题