Files
keyboard/keyBoard/ViewController.m

37 lines
903 B
Mathematica
Raw Permalink Normal View History

2025-10-27 18:47:18 +08:00
//
// ViewController.m
// keyBoard
//
// Created by on 2025/10/27.
//
#import "ViewController.h"
@interface ViewController ()
2025-10-27 21:11:28 +08:00
@property (nonatomic, strong) UITextView *textView;
2025-10-27 18:47:18 +08:00
@end
@implementation ViewController
- (void)viewDidLoad {
[super viewDidLoad];
2025-10-27 21:11:28 +08:00
[self setupTextField];
}
- (void)setupTextField {
CGRect frame = CGRectMake(([UIScreen mainScreen].bounds.size.width - 200)/2, ([UIScreen mainScreen].bounds.size.height - 200)/2, 200, 200);
self.textView = [[UITextView alloc] initWithFrame:frame];
self.textView.text = @"测试";
self.textView.layer.borderColor = [UIColor blackColor].CGColor;
self.textView.layer.borderWidth = 0.5;
[self.view addSubview:self.textView];
2025-10-27 19:42:27 +08:00
2025-10-27 21:11:28 +08:00
[self.textView becomeFirstResponder];
}
2025-10-27 19:42:27 +08:00
2025-10-27 21:11:28 +08:00
- (void)touchesBegan:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event {
[self.textView resignFirstResponder];
2025-10-27 18:47:18 +08:00
}
@end