zoukankan      html  css  js  c++  java
  • objc txt 关联。关系 txt输入框操作

    //.h 文件
    
    
    #import <UIKit/UIKit.h>
    
    @interface ViewController : UIViewController<UITextFieldDelegate> // type 选择outlet 然后在后面加上。<UITextFieldDelegate>
    
    @property (retain, nonatomic) IBOutlet UITextField *TXF; 
    
    
    //.c文件 中。
    
    #import "ViewController.h"
    
    @interface ViewController ()
    
    @end
    
    @implementation ViewController
    @synthesize TXF;
    
    - (void)viewDidLoad
    {
        [super viewDidLoad];
        // Do any additional setup after loading the view, typically from a nib.
        [TXF setDelegate:self];                //不要忘了这。
    }
    
    
    - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
    {
        return (interfaceOrientation != UIInterfaceOrientationPortraitUpsideDown);
    }
    
    //可用于在TXT输入时的判断。在输入之前先判断。把回BOOL型
    - (BOOL)textFieldShouldBeginEditing:(UITextField *)textField
    {
        NSLog(@"first...\n");
        return YES;
    }
    
    @end
  • 相关阅读:
    centos6.x 配置bond
    Js学习(2)
    Js学习(1)
    Java源码阅读计划(1) String<II>
    【461】汉明距离
    【617】合并二叉树
    Java源码阅读计划(1) String<I>
    Dubbo的高可用性
    Dubbo SpringBoot配置方法
    Dubbo基本配置属性
  • 原文地址:https://www.cnblogs.com/qingjoin/p/2567248.html
Copyright © 2011-2022 走看看