开发者

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;
}
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜