• UIActionSheet


    You need to use a UIActionSheet.

    First you need to add UIActionSheetDelegate to your ViewController.h file.

    Then you can reference an actionsheet with:

      UIActionSheet *popup = [[UIActionSheet alloc] initWithTitle:@"Select Sharing option:" delegate:self cancelButtonTitle:@"Cancel" destructiveButtonTitle:nil otherButtonTitles:
                            @"Share on Facebook",
                            @"Share on Twitter",
                            @"Share via E-mail",
                            @"Save to Camera Roll",
                            @"Rate this App",
                            nil];
       popup.tag = 1;
      [popup showInView:self.view];

    Then you have to handle each of the calls.

    - (void)actionSheet:(UIActionSheet *)popup clickedButtonAtIndex:(NSInteger)buttonIndex {
    
      switch (popup.tag) {
        case 1: {
            switch (buttonIndex) {
                case 0:
                    [self FBShare];
                    break;
                case 1:
                    [self TwitterShare];
                    break;
                case 2:
                    [self emailContent];
                    break;
                case 3:
                    [self saveContent];
                    break;
                case 4:
                    [self rateAppYes];
                    break;
                default:
                    break;
            }
            break;
        }
        default:
            break;
     }
    }
  • 相关阅读:
    无缝轮播图
    瀑布流之ajax
    进阶版轮播图
    桌面特效
    3D模型文字动画
    Razor 常用方法
    easyui常用
    C#
    Redis设置记录
    日志三剑客ELK
  • 原文地址:https://www.cnblogs.com/dzhs/p/5522659.html
Copyright © 2020-2023  润新知