所以我有一個帶有textfields形式的uiscrollview。我正在嘗試向背景添加動作,以便用戶在背景上輕擊時鍵盤會縮回。在不禁用uibuttons的情況下在uiscrollview中啓用backgroundTap
我能得到的backgroundTap收起鍵盤,但它禁用我的uibuttons:Detecting hits in UIScrollView while still letting it do it's thing
由於在第二個回答說我加入這個代碼到viewDidLoad中:
UITapGestureRecognizer *singleTap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(backgroundTap:)];
[scrollView addGestureRecognizer: singleTap];
凡backgroundTap是
- (IBAction)backgroundTap:(id)sender
這讓我在uiscrollview上使用backgroundTap撤回鍵盤,但是它禁用了我的cancelButton關閉窗體的模態視圖,並關閉發送HTTP Post的submitButton。
任何想法,爲什麼它禁用uibuttons?