第一次啓動我的應用程序後,我想向用戶展示一個小教程,以解釋我的應用程序的功能。所有UI前面的透明UIImageView
所以我需要設置一個帶有箭頭和標籤的透明UIImageView,其中主要UI(更具體地說,tabbarcontroler中的navigationviewcontroller中的tableviewcontroller)在教程圖像後面仍然可見。
而且,由於教程由多個圖像組成,因此我想添加一個輕擊手勢以切換到另一個圖像。
我試着將一個UIImageView添加到我的tabbarcontroller中,併爲此添加了一個gesturerecogniser,但它對我的水龍頭沒有反應,它只是起作用,就像沒有ImageView - 選擇了表中的魚子一樣,推按鈕。
-(void)nextTap:(UIGestureRecognizer*)nextTap
{
//Show another image
}
-(void)showTutorial
{
NSLog(@"Show tutorial");
UIImageView *tutorialImage = [[UIImageView alloc]initWithImage:[UIImage imageNamed:@"BG"]];
[self.navigationController.tabBarController.view addSubview:tutorialImage];
UITapGestureRecognizer *nextTap = [[UITapGestureRecognizer alloc]initWithTarget:self action:@selector(nextTap:)];
[tutorialImage addGestureRecognizer:nextTap];
}
有人可以告訴我,我應該在哪裏添加我的視圖,而不是它的正常工作?
是否需要用戶交互設置爲YES圖像視圖?這是默認的NO。 – jmstone617 2012-04-06 11:44:52