2011-07-07 157 views
0

我有一个需要在标签上滑动并在滑动标签后滑动的情况,它应该带我到另一个视图。 这是可能的。该标签应该是自我解释性的,因为它应该改变颜色并且应该获得闪烁的效果,以便用户知道在那里滑动。在标签上滑动sholud将一个视图移动到另一个视图

请给我建议。

感谢 RIZWAN

回答

0

做的最好的事情是创造一种姿态和手势附加到的UILabel,继承人一个简单的例子

UISwipeGestureRecognizer *swipe; 
swipe = [[UISwipeGestureRecognizer alloc] initWithTarget:self action:@selector(Gest_SwipedLeft:)]; 
[swipe setDirection:UISwipeGestureRecognizerDirectionLeft]; 
[label addGestureRecognizer:swipe]; 
[swipe release]; 

然后简单地将你的代码推下一个笔尖

-(void)Gest_SwipedLeft:(UISwipeGestureRecognizer *) sender 
UI_iPad_View *controller = [[UI_iPad_View alloc] initWithNibName:@"ipadview" bundle:nil]; 
[[self navigationController] pushViewController:controller animated:YES]; 

// Cleanup 
[controller release], controller = nil; 
} 
相关问题