自拍偷在线精品自拍偷,亚洲欧美中文日韩v在线观看不卡

iOS開發(fā)UIScrollView的touchesBegan和touchesEnd

移動(dòng)開發(fā) iOS
本文為大家介紹了iOS開發(fā)UIScrollView的touchesBegan和touchesEnd。touchesBegan跟touchedEnd沒有提供給UIScrollViewDelegate,所以要自己建立一個(gè)繼承自UIScrollView的class,重寫這兩個(gè)method。

touchesBegan跟touchedEnd沒有提供給UIScrollViewDelegate

所以要自己建立一個(gè)繼承自UIScrollView的class

重寫這兩個(gè)method

myScrollView.h

  1. @interface myScrollView : UIScrollView 
  2. @end 

myScrollView.m

  1. -(void) touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event{ 
  2. [super touchesBegan:touches withEvent:event]; 
  3. if ( !self.dragging ) 
  4. [[self nextResponder] touchesBegan:touches withEvent:event]; 
  5.  
  6. -(void) touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event{ 
  7. [super touchesEnded:touches withEvent:event]; 
  8. if ( !self.dragging ) 
  9. [[self nextResponder] touchesEnded:touches withEvent:event]; 

之後建立UIScrollView就是用myScrollView建立 即可使用這兩個(gè)method

  1. myScrollView *contentScrollView = [[myScrollView alloc] init]; 

 

責(zé)任編輯:閆佳明 來源: apkbus
相關(guān)推薦

2013-03-29 11:06:24

iOS開發(fā)滾動(dòng)視圖UIScrol

2014-06-23 10:42:56

iOS開發(fā)UIScrollVie

2011-08-03 17:32:17

IOS UIScrollVi touch

2014-07-28 17:30:08

UIScrollVieUIPageContr

2011-08-15 11:23:41

iPhone開發(fā)循環(huán)滾動(dòng)UIScrollVie

2015-07-20 10:54:47

IOS提高效率工具

2013-07-24 18:22:02

iOS開發(fā)學(xué)習(xí)iOS開源框架和類

2015-03-03 09:19:12

UIScrollVie

2014-03-06 10:50:59

iOS開發(fā)

2013-07-29 05:01:31

iOS開發(fā)iOS開發(fā)學(xué)習(xí)按鈕拖動(dòng)和點(diǎn)擊

2018-01-16 15:06:36

iPhone XiOS

2014-03-12 11:08:18

2011-12-26 20:25:58

2013-11-21 09:46:36

2011-08-03 17:27:40

iPhone UIScrollVi

2014-08-04 17:46:15

NavBarTarBar

2014-04-23 13:45:40

iOS項(xiàng)目目錄結(jié)構(gòu)開發(fā)流程

2013-07-15 14:46:34

iOS開發(fā)UIScrollVie移動(dòng)開發(fā)

2013-07-21 18:04:22

ASIHttpRequiOS開發(fā)

2013-07-29 04:57:47

iOS開發(fā)iOS開發(fā)學(xué)習(xí)時(shí)間設(shè)置和格式輸出
點(diǎn)贊
收藏

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