Ios 未为TextView调用ToucheSStart
我无法从文本视图调用ToucheSStart。 在一个虚拟项目中,我只有一个视图,其中有一个文本视图,这对我来说很好。 当我尝试在real proj中这样做时,层次结构如下:(我觉得这里有一些问题) 代理未被调用。 .h文件 我觉得我错过了一些很小的东西,请帮忙。Ios 未为TextView调用ToucheSStart,ios,objective-c,Ios,Objective C,我无法从文本视图调用ToucheSStart。 在一个虚拟项目中,我只有一个视图,其中有一个文本视图,这对我来说很好。 当我尝试在real proj中这样做时,层次结构如下:(我觉得这里有一些问题) 代理未被调用。 .h文件 我觉得我错过了一些很小的东西,请帮忙。 感谢您的支持。我尝试了回溯,发现这里的问题是滚动视图。如果我把它取下来,它就可以正常工作。。希望有帮助,刚刚解决了。。我将在几个小时后发布完整的描述,并将其标记为已解决。加载项viewdidload UITapGestureRecog
感谢您的支持。我尝试了回溯,发现这里的问题是滚动视图。如果我把它取下来,它就可以正常工作。。希望有帮助,刚刚解决了。。我将在几个小时后发布完整的描述,并将其标记为已解决。加载项viewdidload UITapGestureRecognitzer*GestureRecognitzer=[[UITapGestureRecognitzer alloc]initWithTarget:self action:@selector(hideKeyBoard:);gestureRecognizer.delegate=self;[滚动视图添加手势识别器:手势识别器];然后定义方法-(void)hideKeyBoard:(id)sender{//执行任何操作,例如隐藏键盘}..在此之前,必须在.h文件中设置scrollview的出口。我想我无法将其标记为已解决..有人请帮助。。。
view (parent)
scrollview(subview)
view (grandSubview
textview.
@interface ActionViewController : UIViewController<UITextViewDelegate>
@property (weak, nonatomic) IBOutlet UITextView *actionTakenTextView;
- (void)viewDidLoad
{
[super viewDidLoad];
actionTakenTextView.delegate=self; //actiontakentextview is the text view i am using.
actionTakenTextView.layer.borderWidth=1;
actionTakenTextView.layer.borderColor=[[UIColor grayColor] CGColor];
// Below property is to set rounded corner of text view.
actionTakenTextView.layer.cornerRadius=5.0;
actionTakenTextView.clipsToBounds=YES;
}
- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event{
NSLog(@"touchesBegan:withEvent:");
[self.view endEditing:YES];
[super touchesBegan:touches withEvent:event];
}