偷偷摘套内射激情视频,久久精品99国产国产精,中文字幕无线乱码人妻,中文在线中文a,性爽19p

UITableView長按手勢UILongPressGestureRecognizer

移動開發(fā) iOS
給UITableView 添加長按手勢,識別長按哪一行,按手勢類UILongPressGestureRecognizer,屬minimumPressDuration表示最短長按的時間.

給UITableView 添加長按手勢,識別長按哪一行。

長按手勢類UILongPressGestureRecognizer, 屬性minimumPressDuration表示最短長按的時間

添加手勢代碼:

  1. UILongPressGestureRecognizer * longPressGr = [[UILongPressGestureRecognizer alloc] initWithTarget:self action:@selector(longPressToDo:)];   
  2.      longPressGr.minimumPressDuration = 1.0;   
  3.      [self.tableView addGestureRecognizer:longPressGr];   
  4.     [longPressGr release];  

響應(yīng)長按事件代碼:

  1. -(void)longPressToDo:(UILongPressGestureRecognizer *)gesture   
  2.  {   
  3.      if(gesture.state == UIGestureRecognizerStateBegan)   
  4.      {   
  5.          CGPoint point = [gesture locationInView:self.tableView];   
  6.         NSIndexPath * indexPath = [self.tableView indexPathForRowAtPoint:point];   
  7.          if(indexPath == nil) return ;   
  8.         //add your code here   
  9.     }   
  10.  }  
責(zé)任編輯:閆佳明 來源: oschina
相關(guān)推薦

2014-12-31 16:48:43

Touch touchevent多點(diǎn)觸摸

2015-07-22 10:34:59

手勢密碼源碼

2011-07-07 16:38:21

iOS UITableVie

2013-06-20 11:21:58

iOS開發(fā)UITableView

2011-08-02 17:14:41

iPhone應(yīng)用 UITableVie

2021-05-20 09:00:27

SwiftUI Swift TapGesture

2022-05-17 12:25:59

物聯(lián)網(wǎng)智能建筑樓宇自控

2011-07-27 11:14:37

iPhone UITableVie

2011-07-27 11:19:33

iPhone UITableVie

2013-05-14 11:18:24

AIR AndroidSwipe手勢

2013-07-18 18:06:53

UITableview

2011-08-15 13:44:07

iPhone開發(fā)UITableView

2012-04-04 22:36:52

iOS5

2013-07-25 14:12:53

iOS開發(fā)學(xué)習(xí)UITableView

2013-12-08 22:02:24

手勢交互交互設(shè)計(jì)交互體驗(yàn)

2013-05-14 11:16:26

AIR Android旋轉(zhuǎn)手勢

2013-06-20 10:50:51

Objective-CiOS左右滑動手勢

2024-06-20 11:11:07

2011-08-08 10:42:46

iPhone UITableVie 分頁

2017-10-10 15:14:23

BUGiOS 11蘋果
點(diǎn)贊
收藏

51CTO技術(shù)棧公眾號