在iPhone App首次启动时显示信息imageview

nim*_*rod 3 iphone app-startup uiimageview ipad ios

我想知道如何将图像添加到覆盖整个屏幕的应用程序,其中包含有关应用程序本身的信息.

这是要求:

  • 仅在首次开始时显示一次
  • 覆盖整个屏幕(包括标签栏和导航栏)
  • 当用户点击图像时,它应该消失,永远不会再出现;)

示例(仅在iPad上找到一个,虽然我需要它用于iPhone):

在此输入图像描述

我怎样才能做到这一点?有没有我可以使用的免费框架?任何提示,信息或链接都非常感谢.

Mat*_*uch 6

  1. 如果之前显示(和解除)帮助视图,请检查NSUserDefaults
  2. 创建UIImageView并将其添加到视图中
  3. 将UITapGestureRecognizer添加到imageView
  4. 在点击手势的操作中删除帮助视图并保存到NSUserDefaults视图被解除.

.

- (void)viewDidLoad {
    [super viewDidLoad];
    if (![[NSUserDefaults standardUserDefaults] boolForKey:@"didDisplayHelpScreen"]) {
        UIWindow *window = [[[UIApplication sharedApplication] windows] lastObject];

        UIImageView *imageView = [[UIImageView alloc] initWithFrame:window.bounds];
        imageView.image = [UIImage imageNamed:@"78-stopwatch"];
        imageView.backgroundColor = [UIColor greenColor];
        imageView.alpha = 0.5;
        UITapGestureRecognizer *tapGesture = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(dismissHelpView:)];
        [imageView addGestureRecognizer:tapGesture];
        imageView.userInteractionEnabled = YES;
        [window addSubview:imageView];
    }
}

- (void)dismissHelpView:(UITapGestureRecognizer *)sender {
    UIView *helpImageView = sender.view;
    [helpImageView removeFromSuperview];
    [[NSUserDefaults standardUserDefaults] setBool:YES forKey:@"didDisplayHelpScreen"];
}
Run Code Online (Sandbox Code Playgroud)