你好,歡迎來到IOS教程網

 Ios教程網 >> IOS編程開發 >> IOS開發綜合 >> UIImageView響應點擊事件

UIImageView響應點擊事件

編輯:IOS開發綜合

NSString *URL =@"http://xxx.jpg";

    NSData *imageData = [[NSDataalloc]initWithContentsOfURL:[NSURLURLWithString:URL]];

    UIImage *image=[[UIImagealloc] initWithData:imageData];

    [imgADBanner setImage:image];

    UITapGestureRecognizer *singleTap = [[UITapGestureRecognizeralloc] initWithTarget:selfaction:@selector(handleSingleTap:)];

    [imgADBanneraddGestureRecognizer:singleTap];

    [singleTap release];

    [imageData release];


- (void)handleSingleTap:(UIGestureRecognizer *)gestureRecognizer { 

    //do something....

}


摘自 sql_help的專欄
  1. 上一頁:
  2. 下一頁:
蘋果刷機越獄教程| IOS教程問題解答| IOS技巧綜合| IOS7技巧| IOS8教程
Copyright © Ios教程網 All Rights Reserved