首页
学习
活动
专区
工具
TVP
发布
社区首页 >问答首页 >UIPopover如何用这样的按钮制作一个popover ?

UIPopover如何用这样的按钮制作一个popover ?

提问于 2018-01-29 01:48:29
回答 2关注 0查看 370

我想知道如何用这样的按钮来创建一个弹出框。

答:

代码语言:txt
复制
UIActionSheet * actionSheet = [[UIActionSheet alloc] initWithTitle: nil 
                                                          delegate: self
                                                 cancelButtonTitle: nil 
                                            destructiveButtonTitle: nil 
                                                 otherButtonTitles: @"Take Photo",
                                                                    @"Choose Existing Photo", nil];

[actionSheet showFromRect: button.frame inView: button.superview animated: YES];

委托对象类中的其他地方..。

代码语言:txt
复制
-(void)actionSheet:(UIActionSheet *)actionSheet clickedButtonAtIndex:(NSInteger)buttonIndex {
    if (buttonIndex == 0) {
         // take photo...
    } 
    else if (buttonIndex == 1) {
         // choose existing photo...
    }
}

回答

和开发者交流更多问题细节吧,去 写回答
相关文章

相似问题

相关问答用户
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档