腾讯云
开发者社区
文档
建议反馈
控制台
首页
学习
活动
专区
工具
TVP
最新优惠活动
文章/答案/技术大牛
搜索
搜索
关闭
发布
登录/注册
精选内容/技术社群/优惠产品,
尽在小程序
立即前往
首页
标签
popover
#
popover
关注
专栏文章
(16)
技术视频
(0)
互动问答
(1)
UIPopover如何用这样的按钮制作一个popover ?
2
回答
popover
、
对象
工口Miku
说唱歌手
类似于其他的回应,但这是很容易实现的比较。 使您的类使用UIActionSheetDelegate。 例子: @interface ExampleViewController : UIViewController <UIActionSheetDelegate> 然后添加到ExampleViewController.mm/m中 - (void)actionSheet:(UIActionSheet *)actionSheet clickedButtonAtIndex:(NSInteger)buttonIndex { //Get the name of the current pressed button NSString *buttonTitle = [actionSheet buttonTitleAtIndex:buttonIndex]; if ([buttonTitle isEqualToString:@"Remove"]) { NSLog(@"Remove this actionSheet"); } if ([buttonTitle isEqualToString:@"Button 1"]) { NSLog(@"Button 1 pressed"); } if ([buttonTitle isEqualToString:@"Button 2"]) { NSLog(@"Button 2 pressed"); } if ([buttonTitle isEqualToString:@"Button 3"]) { NSLog(@"Button 3 pressed"); } if ([buttonTitle isEqualToString:@"Cancel"]) { NSLog(@"Cancel clicked (anywhere away from it)"); } } 现在,在按钮按下的事件中,或者在需要弹出事件的位置/时间,请调用以下命令: - (IBAction)aButtonPressed:(id)sender { NSString *actionSheetTitle = @"Action Sheet"; // Title NSString *destroyTitle = @"Destroy"; // Button titles NSString *button1 = @"Button 1"; NSString *button2 = @"Button 2"; NSString *button3 = @"Button 3"; NSString *cancelTitle = @"Cancel"; UIActionSheet *actionSheet = [[UIActionSheet alloc] initWithTitle:actionSheetTitle delegate:self cancelButtonTitle:cancelTitle destructiveButtonTitle:destroyTitle otherButtonTitles:button1, button2, button3, nil]; [actionSheet showInView:self.view]; } 更多有关这方面的信息:http://developer.apple.com/library/ios/#documentation/uikit/reference/UIActionSheet_Class/Reference/Reference.html ...
展开详请
赞
0
收藏
0
评论
0
分享
类似于其他的回应,但这是很容易实现的比较。 使您的类使用UIActionSheetDelegate。 例子: @interface ExampleViewController : UIViewController <UIActionSheetDelegate> 然后添加到ExampleViewController.mm/m中 - (void)actionSheet:(UIActionSheet *)actionSheet clickedButtonAtIndex:(NSInteger)buttonIndex { //Get the name of the current pressed button NSString *buttonTitle = [actionSheet buttonTitleAtIndex:buttonIndex]; if ([buttonTitle isEqualToString:@"Remove"]) { NSLog(@"Remove this actionSheet"); } if ([buttonTitle isEqualToString:@"Button 1"]) { NSLog(@"Button 1 pressed"); } if ([buttonTitle isEqualToString:@"Button 2"]) { NSLog(@"Button 2 pressed"); } if ([buttonTitle isEqualToString:@"Button 3"]) { NSLog(@"Button 3 pressed"); } if ([buttonTitle isEqualToString:@"Cancel"]) { NSLog(@"Cancel clicked (anywhere away from it)"); } } 现在,在按钮按下的事件中,或者在需要弹出事件的位置/时间,请调用以下命令: - (IBAction)aButtonPressed:(id)sender { NSString *actionSheetTitle = @"Action Sheet"; // Title NSString *destroyTitle = @"Destroy"; // Button titles NSString *button1 = @"Button 1"; NSString *button2 = @"Button 2"; NSString *button3 = @"Button 3"; NSString *cancelTitle = @"Cancel"; UIActionSheet *actionSheet = [[UIActionSheet alloc] initWithTitle:actionSheetTitle delegate:self cancelButtonTitle:cancelTitle destructiveButtonTitle:destroyTitle otherButtonTitles:button1, button2, button3, nil]; [actionSheet showInView:self.view]; } 更多有关这方面的信息:http://developer.apple.com/library/ios/#documentation/uikit/reference/UIActionSheet_Class/Reference/Reference.html
热门
专栏
Jerry的SAP技术分享
10.8K 文章
159 订阅
Android知识点总结
583 文章
64 订阅
acoolgiser_zhuanlan
156 文章
25 订阅
java 微风
397 文章
32 订阅
code秘密花园
571 文章
60 订阅
热门
标签
更多标签
ICP备案
云服务器
对象存储
云点播
即时通信 IM
实时音视频
DNS 解析 DNSPod
内容分发网络 CDN
人脸识别
私有网络
python
java
javascript
人工智能
android
领券