Swiping on a Label sholud move one view to another
I have a requirement in which I need to swipe on a label and after swiping on it,it should take me to the other view. Will it be pos开发者_StackOverflow中文版sible. The Label should be self explanatory as it should change the color and should get a blinking effect so that the user knows to swipe there.
Please suggest me.
Thanks Rizwan
The best thing to do is to create a gesture and attach that gesture to the uilabel, heres a simple example
UISwipeGestureRecognizer *swipe;
swipe = [[UISwipeGestureRecognizer alloc] initWithTarget:self action:@selector(Gest_SwipedLeft:)];
[swipe setDirection:UISwipeGestureRecognizerDirectionLeft];
[label addGestureRecognizer:swipe];
[swipe release];
Then simply apply your code to push the next nib
-(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;
}
精彩评论