[英]iOS first launch tour - detecting if the app is launched for the first time
[英]Walking Tour for the first time app user
我正在为应用程序中的首次用户实施徒步旅行。 我不知道有没有更好的方法,但是我实现了以下方法,该方法通过轻击手势识别来检测用户的轻击。
我想知道如果我有多个图像怎么办? 还是有更好的或推荐的徒步旅行方式?
- (BOOL)application:(UIApplication *)application
didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
UIImageView *imageView = [[UIImageView alloc]
initWithImage:[UIImage imageNamed:@"yourimage.png"]];
[self.window addSubview:imageView];
UITapGestureRecognizer * recognizer = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(handleTap:)];
recognizer.delegate = self;
[imageView addGestureRecognizer:recognizer];
imageView.userInteractionEnabled = YES;
self.imageView = imageView;
}
- (void) handleTap:(UITapGestureRecognizer *)recognize
{
[self.imageView removeFromSuperView];
}
您要如何实现此完全取决于您。 您提到的方法没有错。
对于您的问题,如果您有多个图像,则可以创建一个容器view
在该容器view
上可以添加多个imageViews
。 在该容器上的“触摸”上,您可以根据自己的顺序显示隐藏图像视图。
使用PageViewController将是另一个不错的选择。 您可以尝试使用此控件。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.