gpt4 book ai didi

iOS 9.0 - 从 UIAlertController 操作表中删除顶部栏

转载 作者:塔克拉玛干 更新时间:2023-11-02 09:13:36 24 4
gpt4 key购买 nike

在使用 UIAlertController 创建操作表时,我看到顶部栏始终显示。 This SO post 建议将标题设置为 nil - 这可能适用于 iOS 8.0,但我在 iOS 9.0 上看到顶部栏。

enter image description here

最佳答案

同时将message设置为nil:

UIAlertController *actionSheet= [UIAlertController
alertControllerWithTitle:nil
message:nil
preferredStyle:UIAlertControllerStyleActionSheet];
UIAlertAction *actionSheetButton1 = [UIAlertAction
actionWithTitle:@"Button 1"
style:UIAlertActionStyleDefault
handler:^(UIAlertAction * action)
{
NSLog(@"Button 1 pressed");
}];
UIAlertAction *actionSheetButton2 = [UIAlertAction
actionWithTitle:@"Button 2"
style:UIAlertActionStyleDefault
handler:^(UIAlertAction * action)
{
NSLog(@"Button 2 pressed");
}];
UIAlertAction *actionSheetButton3 = [UIAlertAction
actionWithTitle:@"Close Button"
style:UIAlertActionStyleCancel
handler:^(UIAlertAction * action)
{
NSLog(@"Close Button pressed");
}];

[actionSheet addAction:actionSheetButton1];
[actionSheet addAction:actionSheetButton2];
[actionSheet addAction:actionSheetButton3];
[self presentViewController:actionSheet animated:YES completion:nil];

enter image description here

关于iOS 9.0 - 从 UIAlertController 操作表中删除顶部栏,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33308913/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com