<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                ??一站式輕松地調用各大LLM模型接口,支持GPT4、智譜、豆包、星火、月之暗面及文生圖、文生視頻 廣告
                這次講的內容很簡單: 1.首先我們還是創建一個Single View Application,然后打開MainStoryboard_iphone.storyboard,在里面放入倆lable和兩個TextFiled: ![](https://box.kancloud.cn/2016-03-09_56dfc828b925f.png) 2.接著開始寫代碼:ViewController.h: ~~~ #import <UIKit/UIKit.h> @interface ViewController : UIViewController{ UITextField *nameField; UITextField *numberField; } @property (nonatomic,retain) IBOutlet UITextField *nameField; @property (nonatomic,retain) IBOutlet UITextField *numberField; - (IBAction)backgroundTap:(id)sender; - (IBAction)textFiledReturnEditing:(id)sender; @end ~~~ ViewController.m: ~~~ #import "ViewController.h" @interface ViewController () @end @implementation ViewController @synthesize nameField; @synthesize numberField; - (void)viewDidLoad { [super viewDidLoad]; // Do any additional setup after loading the view, typically from a nib. } - (void)viewDidUnload { [super viewDidUnload]; // Release any retained subviews of the main view. } //點擊屏幕空白view時觸發的事件 - (IBAction)backgroundTap:(id)sender{ [nameField resignFirstResponder];//通知文本失去第一響應者狀態 [numberField resignFirstResponder]; } //點擊return時觸發的事件? - (IBAction)textFiledReturnEditing:(id)sender { [sender resignFirstResponder]; } - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPhone) { return (interfaceOrientation != UIInterfaceOrientationPortraitUpsideDown); } else { return YES; } } @end ~~~ 3.接著我們連接操作和輸出口: 將背景view的類別設置為UIControl,這樣我們就能對屏幕的事件進行處理了,將Control的touch down輸出連接到backgroundTap事件上,因為點擊軟鍵盤會觸發did end on exit,那我們就把兩個textFiled的did end on exit輸出連接到textFiledReturnEditing事件上。當然我們不要忘記將兩個textFiled控件的輸出與ViewController的相應控件接口連接在一起。 4.運行程序看看效果: 點擊textFiled時: ![](https://box.kancloud.cn/2016-03-09_56dfc828caaa6.png) 點擊return或點擊界面空白時: ![](https://box.kancloud.cn/2016-03-09_56dfc828ec54d.png)
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看