gpt4 book ai didi

ios - 在 iOS 的 UITabbarcontroller 中添加 Actionsheet

转载 作者:塔克拉玛干 更新时间:2023-11-02 08:03:28 26 4
gpt4 key购买 nike

我在 UIViewController 中创建了 UITabbar。然后我向它添加了一个 UIActionSheet 但是当操作表出现时,当单击“取消”按钮的顶部时,它可以工作,但是当我单击“取消”的底部时,没有任何响应。我使用此代码添加操作表:

actionSheetDelete = [[UIActionSheet alloc] initWithTitle:@"Do you want to continue?" delegate:self cancelButtonTitle:@"Cancel" destructiveButtonTitle:@"Delete Item(s)" otherButtonTitles:nil];
actionSheetDelete.actionSheetStyle = UIActionSheetStyleBlackOpaque;
[actionSheetDelete showInView:self.view];
[actionSheetDelete release];

当我点击操作表时,我总是在控制台中显示此警报:

Presenting action sheet clipped by its superview. Some controls might not respond to touches. On iPhone try -[UIActionSheet showFromTabBar:] or -[UIActionSheet showFromToolbar:] instead of -[UIActionSheet showInView:].

你有什么建议吗?提前致谢

最佳答案

尝试:

[actionSheetDelete showFromTabBar:self.tabBarController.tabBar];

关于ios - 在 iOS 的 UITabbarcontroller 中添加 Actionsheet,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18178656/

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