gpt4 book ai didi

ios - XCode/ Storyboard :Creating a Modal View

转载 作者:行者123 更新时间:2023-11-28 22:53:40 29 4
gpt4 key购买 nike

我正在阅读 apple 开发者库,并想使用像 apple 在图片中显示的子菜单:

enter image description here

第一个问题:那是模态视图吗?如果是,如何创建类似的东西?这个子菜单是否有自己的 Controller 和 View ,或者是在上面的 View 中声明的所有内容?我正在使用 Storyboard。

最佳答案

不,这是一个 UIActionSheet,它没有 nib 文件或类文件,你可以这样使用它

UIActionSheet *sheet = [[UIActionSheet alloc] initWithTitle:@"Title" 
delegate:self
cancelButtonTitle:@"cancel"
destructiveButtonTitle:nil
otherButtonTitles: nil];
[sheet showInView:self.view];

//Function gets called when user taps on a button
-(void)actionSheet:(UIActionSheet *)actionSheet clickedButtonAtIndex:(NSInteger)buttonIndex
{

}

关于ios - XCode/ Storyboard :Creating a Modal View,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11274116/

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