menuView= [[UIImageView alloc] initWithFrame:CGRectMake(0,411, 320,49)];
UIButton *test = [UIButton buttonWithType:UIButtonTypeCustom ];
test.frame = CGRectMake(0, 0, 80, 49);
[test addTarget:self action:@selector(buttonPressed:) forControlEvents:UIControlEventTouchUpInside];
[menuView addSubview:test];
[self.view addSubview:menuView];
我觸摸裏面(測試)按鈕。但沒有工作。爲什麼??UIButton Touch事件不起作用
呢'self'實現一個名爲'buttonPressed:'的方法? – 2012-01-14 08:41:36