顯示幫助視圖我已經把UIImageView放在後面有一些UIButtons。我如何禁用這些按鈕的用戶交互?如果我觸摸此圖像的按鈕位於後面,它們會響應觸摸事件。禁用背景圖像背後的視圖交互
CODE FOR IMAGE背景:
self.helpBackground = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, 1024, 768)];
self.helpBackground.backgroundColor = [UIColor colorWithWhite:0 alpha:0.75];
self.helpBackground.hidden = YES;
[self.view addSubview:self.helpBackground];
我使用self.helpBackground.userInteractionEnabled = NO;但沒有工作。
謝謝。
你需要禁用用戶交互的所有按鈕不helpBackground ImageView的..! – Vidhyanand 2014-09-03 13:34:50
當helpBackground打開時,您可以將所有按鈕設置爲button.hidden = YES。 – 2014-09-03 13:37:28