Chinaunix首页 | 论坛 | 博客
  • 博客访问: 90992
  • 博文数量: 22
  • 博客积分: 486
  • 博客等级: 下士
  • 技术积分: 262
  • 用 户 组: 普通用户
  • 注册时间: 2012-03-07 19:26
文章分类

全部博文(22)

文章存档

2012年(22)

我的朋友

分类: 嵌入式

2012-07-05 09:32:52


点击(此处)折叠或打开

  1. //.h 文件
  2. #import
  3. @interface ViewController : UIViewController // type 选择outlet 然后在后面加上。
  4. @property (retain, nonatomic) IBOutlet UITextField *TXF;
  5. //.c文件 中。
  6. #import "ViewController.h"
  7. @interface ViewController ()
  8. @end
  9. @implementation ViewController
  10. @synthesize TXF;
  11. - (void)viewDidLoad
  12. {
  13. [super viewDidLoad];
  14. // Do any additional setup after loading the view, typically from a nib.
  15. [TXF setDelegate:self]; //不要忘了这。
  16. }
  17. - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
  18. {
  19. return (interfaceOrientation != UIInterfaceOrientationPortraitUpsideDown);
  20. }
  21. //可用于在TXT输入时的判断。在输入之前先判断。把回BOOL型
  22. - (BOOL)textFieldShouldBeginEditing:(UITextField *)textField
  23. {
  24. NSLog(@"first...\n");
  25. return YES;
  26. }
  27. @end

阅读(433) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~