UITextView没有响应

时间:2013-11-28 06:09:44

标签: ios uitextview

我在代码中使用textview使用以下代码

UITextView *ObservationTextView3=[[UITextView alloc]init];
ObservationTextView3.frame=CGRectMake(45, ObservationLabel3.frame.origin.y+ObservationLabel3.frame.size.height, 410, 70);
[ObservationTextView3 setKeyboardType:UIKeyboardTypeDefault];
ObservationTextView3.font=[UIFont fontWithName:@"Helvetica" size:14];
ObservationTextView3.delegate=self;
ObservationTextView3.tag=139;
ObservationTextView3.text = @"";
ObservationTextView3.layer.borderWidth=1.0f;
ObservationTextView3.layer.borderColor=[UIColor lightGrayColor].CGColor;
ObservationTextView3.layer.cornerRadius=4.0f;
[_BeverageRoutineScroll addSubview:ObservationTextView3];

但是我无法让这个文本视图回应我已经尝试了很多东西,但是事情变得多了。

请帮帮我。

1 个答案:

答案 0 :(得分:1)

试试这个:

[self.view bringSubviewToFront:yourTextView];

[self.view sendSubViewToBack:yourScrollview];

OR

[self.yourScrollView setUserInteractionEnabled:YES];

[self.yourTextView setUserInteractionEnabled:YES];

OR

检查您的滚动视图内容大小和文本视图框