1.点击textField没有响应
(1)textField上面还有视图
<pre name="code" class="objc"> UITextField *tf = [[UITextField alloc] initWithFrame:CGRectMake(50, 100, 220, 40)];
tf.backgroundColor = [UIColor yellowColor];
tf.borderStyle = UITextBorderStyleRoundedRect;
[self.window addSubview:tf];
[tf release];
UIView *view = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 320, 568)];
view.backgroundColor = [UIColor redColor];
[self.window addSubview:view];
[view release];
(2)textField 超出父视图的管理范围
视图能够管理它范围内所有的子视图,如果子视图超出了父视图的范围,就无法响应交互.
<pre name="code" class="objc"> UIView *bgView = [[UIVi