![](/img/trans.png)
[英]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.