uiswipegesturerecognizer

How to add Swipe Gestures to UITableView cell?

故事扮演 提交于 2019-11-27 12:27:34
问题 I added this code in cellForRowAtIndexPath UISwipeGestureRecognizer *gestureR = [[UISwipeGestureRecognizer alloc] initWithTarget:self action:@selector(handleSwipeFrom:)]; [gestureR setDirection:UISwipeGestureRecognizerDirectionRight];//|UISwipeGestureRecognizerDirectionRight)]; [cell addGestureRecognizer:gestureR]; it works fine. But I want UISwipeGestureRecognizerDirectionLeft so Added like this [gestureR setDirection:UISwipeGestureRecognizerDirectionLeft

how detect swipe gesture direction?

谁都会走 提交于 2019-11-27 12:26:20
i need to detect direction of my swipe gesture and i've got problem with it. gesture is working, but i don't know how to detect direction. ... swipeGesture = [[UISwipeGestureRecognizer alloc] initWithTarget:self action:@selector(detectSwipe:)]; [swipeGesture setNumberOfTouchesRequired:1]; [swipeGesture setDirection:UISwipeGestureRecognizerDirectionDown | UISwipeGestureRecognizerDirectionUp]; [appView addGestureRecognizer:swipeGesture]; -(void)detectSwipe:(UISwipeGestureRecognizer *)recognizer { switch (recognizer.direction) { case UISwipeGestureRecognizerDirectionUp: NSLog(@"smth1"); break;

SwiperefreshLayout in Android

谁说我不能喝 提交于 2019-11-27 01:56:17
问题 i am using SwipeRefreshLayout in my below layout: <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="wrap_content" android:layout_height="wrap_content" android:background="@color/homePageBackground" android:orientation="vertical" > <android.support.v4.widget.SwipeRefreshLayout android:id="@+id/swipeRefreshLayout_listView" android:layout_width="match_parent" android:layout_height="match_parent" > <LinearLayout

How to enable swipe to delete cell in a TableView?

≯℡__Kan透↙ 提交于 2019-11-27 00:19:26
问题 I have a UIViewController that implements TableViews delegate and datasource protocols. Now I want to add "swipe to delete" gesture to cells. How should I go about it. I have given a blank implementation of commitEditingStyle method and also set the Editing property to YES. Still the swipe feature is not coming . Now Do I need to separately add UISwipeGesture to each cell ? Or am I missing something ? 回答1: You don't have to set editing:YES if you need to show Delete button on cell swipe. You

How to recognize swipe in all 4 directions?

删除回忆录丶 提交于 2019-11-26 18:13:49
问题 I need to recognize swipes in all directions ( Up/Down/Left/Right ). Not simultaneously, but I need to recognize them. I tried: UISwipeGestureRecognizer *Swipe = [[UISwipeGestureRecognizer alloc] initWithTarget:self action:@selector(SwipeRecognizer:)]; Swipe.direction = (UISwipeGestureRecognizerDirectionLeft | UISwipeGestureRecognizerDirectionRight | UISwipeGestureRecognizerDirectionDown | UISwipeGestureRecognizerDirectionUp); [self.view addGestureRecognizer:Swipe]; [Swipe release]; but

how detect swipe gesture direction?

家住魔仙堡 提交于 2019-11-26 15:59:52
问题 i need to detect direction of my swipe gesture and i've got problem with it. gesture is working, but i don't know how to detect direction. ... swipeGesture = [[UISwipeGestureRecognizer alloc] initWithTarget:self action:@selector(detectSwipe:)]; [swipeGesture setNumberOfTouchesRequired:1]; [swipeGesture setDirection:UISwipeGestureRecognizerDirectionDown | UISwipeGestureRecognizerDirectionUp]; [appView addGestureRecognizer:swipeGesture]; -(void)detectSwipe:(UISwipeGestureRecognizer *)recognizer

Setting direction for UISwipeGestureRecognizer

时间秒杀一切 提交于 2019-11-26 04:59:42
问题 I want to add simple swipe gesture recognition to my view based iPhone project. Gestures in all directions (right, down, left, up) should be recognized. It is stated in the docs for UISwipeGestureRecognizer: You may specify multiple directions by specifying multiple UISwipeGestureRecognizerDirection constants using bitwise-OR operands. The default direction is UISwipeGestureRecognizerDirectionRight. However for me it doesn\'t work. When all four directions are OR\'ed only left and right

How to recognize swipe in all 4 directions

孤街醉人 提交于 2019-11-26 04:30:36
问题 I need to use swipe to recognize swipe gesture down and then right. But on swift UISwipeGestureRecognizer has predeterminate Right direction.. And I don\'t know how make this for use other directions.. 回答1: You need to have one UISwipeGestureRecognizer for each direction. It's a little weird because the UISwipeGestureRecognizer.direction property is an options-style bit mask, but each recognizer can only handle one direction. You can send them all to the same handler if you want, and sort it