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

iPhone App里彈出輸入面板案例實(shí)現(xiàn)

移動(dòng)開發(fā) iOS
iPhone App里彈出輸入面板案例實(shí)現(xiàn)是本文要介紹的內(nèi)容,主要是來學(xué)習(xí)輸入面板功能的是實(shí)現(xiàn),如果需要在您的iPhone App里加入文字輸入面板功能。

iPhone App里彈出輸入面板案例實(shí)現(xiàn)是本文要介紹的內(nèi)容,主要是來學(xué)習(xí)輸入面板功能的是實(shí)現(xiàn),如果需要在您的iPhone App里加入文字輸入面板功能,喜歡游戲的朋友們都明白,比如游戲破紀(jì)錄后輸入玩家名字。具體輸入面板功能的實(shí)現(xiàn)來看本文詳細(xì)內(nèi)容。

在.h里先宣告

  1. UITextField *yourtextfield;  
  2. @property (nonatomic, retain, readonly) UITextField yourtextfield; 

在.m里

  1. @synthesize yourtextfield; 

然后自己加上

  1. - (UITextField *)yourtextfield  
  2. {  
  3.  
  4. if (yourtextfield == nil)  
  5.     {  
  6.         CGRect frame = CGRectMake(x, y, width, height);         //textfield的位置大小  
  7.         yourtextfield = [[UITextField alloc] initWithFrame:frame];  
  8.         yourtextfield.enabled = TRUE;  
  9.         yourtextfield.borderStyle = UITextBorderStyleNone;  
  10.         yourtextfield.textColor = [UIColor blackColor];  
  11.         yourtextfield.font = [UIFont systemFontOfSize:14.0];  
  12.         yourtextfield.placeholder = @"user name";  
  13.         yourtextfield.backgroundColor = [UIColor whiteColor];  
  14.         yourtextfield.autocorrectionType = UITextAutocorrectionTypeNo;    // no auto correction support  
  15.          
  16.         yourtextfield.keyboardType = UIKeyboardTypeDefault;    // 一般的鍵盤style  
  17.         yourtextfield.returnKeyType = UIReturnKeyDone;  
  18.          
  19.         yourtextfield.clearButtonMode = UITextFieldViewModeWhileEditing;     //可以一次清除輸入中的文字  
  20.          
  21.         yourtextfield.tag = kViewTag;        // tag this control so we can remove it later for recycled cells  
  22.          
  23.         textFieldNormalyourtextfield.delegate = self;    // 讓user輸入完,按下done 鍵盤會(huì)自動(dòng)收起來  
  24.          
  25.         // Add an accessibility label that describes what the text field is for.  
  26.         [yourtextfield setAccessibilityLabel:NSLocalizedString(@"username", @"")];  
  27.     }     
  28.     return yourtextfield;  

最后要在dealloc 中release

  1. [yourtextfield release]; 

小結(jié):iPhone App里彈出輸入面板案例實(shí)現(xiàn)的內(nèi)容介紹完了,希望通過本文的學(xué)習(xí)能對你有所幫助!

責(zé)任編輯:zhaolei 來源: CocoaChina
相關(guān)推薦

2011-07-22 17:24:46

iPhone 視圖

2011-08-18 15:40:20

iPhone文本切頁

2011-08-15 15:44:46

iPhone開發(fā)PDF

2011-08-18 16:24:44

iPhone開發(fā)圖片

2011-08-19 11:10:31

iPhone應(yīng)用

2011-08-19 10:13:05

iPhone開發(fā)

2011-08-16 15:48:37

iPhone開發(fā)抓圖程序

2011-08-17 16:12:20

iPhone應(yīng)用程序

2011-08-16 15:36:47

iPhone應(yīng)用測試

2011-08-17 16:23:31

iPhone開發(fā)UIViewContr

2011-08-18 15:24:40

iPhone國際化

2011-08-19 10:05:30

iPhone開發(fā)

2011-08-19 10:01:09

iPhone應(yīng)用SqliteUITableView

2011-08-18 16:42:07

iPhone應(yīng)用APNS推送

2011-08-17 16:29:12

iPhone開發(fā)UIButton

2011-08-18 16:03:34

iPhone上傳圖片

2011-08-03 17:44:57

iPhone App 文件

2011-07-29 14:18:46

iPhone開發(fā) 動(dòng)畫

2011-08-19 09:54:40

iPhone開發(fā)電子書字符串

2011-07-19 17:15:29

iPhone App
點(diǎn)贊
收藏

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