开发者

UITapGestureRecognizer and number of tabs

开发者 https://www.devze.com 2023-02-22 04:28 出处:网络
I add tabgesture to view using UITapGestureRecognizer *tapRecognizer = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(tapped:)];

I add tabgesture to view using

UITapGestureRecognizer *tapRecognizer = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(tapped:)];
[tapRecognizer setNumberOfTapsRequired:1];
[tapRecognizer setDelegate:self];
[holderView a开发者_开发知识库ddGestureRecognizer:tapRecognizer];
[tapRecognizer release];

how to catch the number of tabs and rest the size of the view after to 2 tabs

best regards


You are setting number of taps required to 1, change the line to...

[tapRecognizer setNumberOfTapsRequired:2];

and it will only fire when there is a double tap.

0

精彩评论

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