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

iPhone開發(fā)應(yīng)用之顯示無按鈕警告框

移動(dòng)開發(fā) iOS
iPhone開發(fā)應(yīng)用之顯示無按鈕警告框是本文要介紹的內(nèi)容,主要講述的是警告框案例的實(shí)現(xiàn),我們一起來看詳細(xì)內(nèi)容講解。

iPhone開發(fā)應(yīng)用之顯示無按鈕警告框是本文要介紹的內(nèi)容,主要講述的是警告框案例的實(shí)現(xiàn),我們一起來看詳細(xì)內(nèi)容講解。如果要顯示一個(gè)不需要用戶交互的異步信息,可以創(chuàng)建一個(gè)不帶按鈕的UIAlertView。

一般無按鈕的警告框有一個(gè)特點(diǎn),它不會自動(dòng)消失。因此,我們在做完事情之后要收到的讓警告框消失??梢哉{(diào)用此方法

  1. – dismissWithClickedButtonIndex:animated: 

下面的代碼是創(chuàng)建一個(gè)無按鈕的UIAlertView,讓其在3s之后消失。

  1. UIAlertView *baseAlert;  
  2.  
  3. - (void) action: (UIBarButtonItem *) item  
  4. {  
  5.     baseAlert = [[[UIAlertView alloc] initWithTitle:@"Please Wait" message:nil delegate:self 
  6. cancelButtonTitle:nil otherButtonTitles: nil] autorelease];  
  7.     [baseAlert show];  
  8.  
  9. // Create and add the activity indicator  
  10. UIActivityIndicatorView *aiv = [[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleWhiteLarge];  
  11. aiv.center = CGPointMake(baseAlert.bounds.size.width / 2.0f, baseAlert.bounds.size.height - 40.0f);  
  12. [aiv startAnimating];  
  13. [baseAlert addSubview:aiv];  
  14. [aiv release];  
  15.  
  16.  
  17. // Auto dismiss after 3 seconds  
  18. [self performSelector:@selector(performDismiss) withObject:nil afterDelay:3.0f];  
  19. }  
  20.  
  21. - (void) performDismiss  
  22. {  
  23.     [baseAlert dismissWithClickedButtonIndex:0 animated:NO];  

效果如下圖:

iPhone開發(fā)應(yīng)用之顯示無按鈕警告框

小結(jié):iPhone開發(fā)應(yīng)用之顯示無按鈕警告框的內(nèi)容介紹完了,希望通過本文的學(xué)習(xí)能對你有所幫助!

責(zé)任編輯:zhaolei 來源: 互聯(lián)網(wǎng)
相關(guān)推薦

2011-08-11 10:16:23

iPhoneUIView視圖

2011-08-11 10:27:37

iPhoneUIView視圖

2011-08-16 19:02:23

iPhone開發(fā)繪圖

2011-08-10 10:23:20

iPhoneArchivingNSCoder

2011-08-15 18:02:32

iPhone開發(fā)表視圖

2011-08-12 11:31:46

iPhoneUIView動(dòng)畫

2011-08-11 11:51:07

iPhone鍵盤

2011-08-19 14:27:29

iPhone開發(fā)

2011-08-11 17:32:51

iPhone視圖

2011-08-12 10:16:10

iPhone通訊錄聯(lián)系人

2011-07-22 15:32:53

iPhone 按鈕 對話框

2011-08-10 15:36:26

iPhone靜態(tài)庫控件

2011-06-01 14:20:37

Android

2011-07-19 09:46:38

2011-07-08 14:58:16

iPhone Xcode iOS

2011-07-19 09:58:36

2011-08-08 16:56:44

iPhone 字符處理 視圖

2011-08-08 10:10:14

iPhone開發(fā) 圖片 方法

2011-08-09 17:29:29

iPhone文件屏幕

2011-08-10 10:10:21

iPhoneUIPopoverCo
點(diǎn)贊
收藏

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