【发布时间】:2016-11-11 06:31:35
【问题描述】:
我想在 UIAlertAction 的一个选项中添加复选框,即 uibutton 和 uilabel UIAlertController 中另一个 UIAlertAction 中的唯一按钮。
请帮助和建议如何实现它。
UIAlertController *alert = [UIAlertController alertControllerWithTitle:@"My Alert"
message:@"This is an action sheet."
preferredStyle:UIAlertControllerStyleActionSheet]; // 1
UIAlertAction *firstAction = [UIAlertAction actionWithTitle:@"one"
style:UIAlertActionStyleDefault handler:^(UIAlertAction * action) {
NSLog(@"You pressed button one");
}]; // 2
UIAlertAction *secondAction = [UIAlertAction actionWithTitle:@"two"
style:UIAlertActionStyleDefault handler:^(UIAlertAction * action) {
NSLog(@"You pressed button two");
}]; // 3
[alert addAction:firstAction]; // 4
[alert addAction:secondAction]; // 5
【问题讨论】:
标签: ios objective-c uialertcontroller uialertsheet