tap

How to detect android double tap? [duplicate]

倾然丶 夕夏残阳落幕 提交于 2019-12-21 21:43:12
问题 This question already has answers here : How to listen to doubletap on a view in android? [duplicate] (1 answer) Android: How to detect double-tap? (20 answers) Closed 5 years ago . How to detect the double tap in android? I implement OnDoubleTapListener and wrote this: public boolean onDoubleTapEvent(MotionEvent e) { // TODO Auto-generated method stub if(e.getAction() == 1){ Toast.makeText(getApplicationContext(),"Double Tap", Toast.LENGTH_SHORT).show(); } return true; } But it is not

弹出菜单效果

☆樱花仙子☆ 提交于 2019-12-20 21:11:40
- (void)showPopoverAtPoint:(CGPoint)point inView:(UIView *)view withContentView:(UIView *)cView {  //self为弹出内容cView的superview self.boxFrame = cView.frame; self.contentView = cView; UIWindow *window = [UIApplication sharedApplication].keyWindow; if(!window) { window = [[UIApplication sharedApplication].windows objectAtIndex:0]; } UIView *topView = window;//[[window subviews] objectAtIndex:0]; CGPoint topPoint = [topView convertPoint:point fromView:view]; CGRect topViewBounds = topView.bounds; _contentView.frame = _boxFrame; _contentView.hidden = NO; [self addSubview:_contentView]; self.layer

Detect tap on title of callout

一世执手 提交于 2019-12-20 03:02:10
问题 how do I detect a tap on the title of a callout of a annotation? I already have a right callout accessory and a left one, but I want to detect if a user taps on the title (which is in the center on the callout). If this is not possible, how do I disable hiding the callout if I tap on the title? 回答1: it's little late to the answer your question but I'm dealing with same kind of problem recently and make my solution by my self with trial and error. maybe I can help someone who dealing with same

How to use tap gesture in Accessibility in swift?

风流意气都作罢 提交于 2019-12-20 01:39:27
问题 I'm working on app for blind people first i needed to use swipe gesture and after search i can do it by using override func accessibilityScroll( direction: UIAccessibilityScrollDirection)-> Bool { if direction == UIAccessibilityScrollDirection.Left { Do what you want to do } } Now I need to use tap gesture and I can't find any function to use make custom tap in Accessibility can anyone help me pleasee! Thanks 回答1: You shouldn't use tap gesture for UIAccessibility ot try to add tap gestures to

Is it possbile to test for expected errors when the testee exits with failure using TAP within Perl?

点点圈 提交于 2019-12-19 09:17:08
问题 Suppose you're running some unit tests and you want to see if the method ( or script or function or whatever) you're testing fails as it should. How do you setup such a test? I'm hoping for something like this: ok( $obj->method($my, $bad, $params) == DEATH, 'method dies as expected'); although I don't see how it would work since method die s when passed bad parameters and the test script stops. Is there another way? 回答1: Have you tried Test::Exception? dies_ok should do what you want. Eg: #

c# .net why does Task.Run seem to handle Func<T> differently than other code?

北城以北 提交于 2019-12-18 14:14:49
问题 The new Task.Run static method that's part of .NET 4.5 doesn't seem to behave as one might expect. For example: Task<Int32> t = Task.Run(()=>5); compiles fine, but Task<Int32> t = Task.Run(MyIntReturningMethod); ... public Int32 MyIntReturningMethod() { return (5); } complains that MyIntReturningMethod is returning the wrong type. Perhaps I am just not understanding which overload of Task.Run is being called. But in my mind, my lambda code above looks a lot like a Func<Int32> , and

Why/when do I have to tap twice to trigger click on iOS

守給你的承諾、 提交于 2019-12-18 11:17:44
问题 Ok I feel like I'm crazy... I'm looking at Mobile Safari on iOs 6.0. I can't seem to establish any rhyme or reason as to when tapping on an element will trigger click. In many cases, it seems I need to tap once to trigger a hover and then again to trigger a click. The Mobile Safari spec says : "... The flow of events generated by one-finger and two-finger gestures are conditional depending on whether or not the selected element is clickable or scrollable... A clickable element is a link, form

OnTap listener implementation

僤鯓⒐⒋嵵緔 提交于 2019-12-18 09:03:40
问题 I have a doubt that is on tap listener implemented on a particular button, or image view or view? because the sites which I surfed only shows for the whole layout and I want my action to be performed on the tapping of a view. please help. Thank you. 回答1: Any view can be setup with an onClickListener() which is part of the view class. The easiest way to do it is when you setup the references to your view in the onCreate() method. Here is an example for a image view: ImageView iv = (ImageView)

UITapGestureRecognizer on UIImageView within UITablevlewCell not getting called

时光怂恿深爱的人放手 提交于 2019-12-17 16:25:02
问题 I currently have a custom UITableViewCell which contains a UIImageView and trying to add a UITapGestureRecognizer on the UIImageView with no luck. here is snippet of the code. //within cellForRowAtIndexPath (where customer table cell with imageview is created and reused) UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(handleImageTap:)]; tap.cancelsTouchesInView = YES; tap.numberOfTapsRequired = 1; tap.delegate = self; [imageView

Get coordinates on tapping map in android

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-17 09:41:52
问题 I'm trying to make something like this: I have a mapactivity and when the user taps the map it shows the coordinates of that location. I already overrided the onclick method but it isn't even called. Any Idea? public class MapPoint extends MapActivity implements OnClickListener { @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.mappoints); MapView map = (MapView)findViewById(R.id.mapview); map.setOnClickListener(this); map