2
我有下面的代碼,當我按下UIButton時,沒有任何東西被調用,並且不會崩潰。UIButton的addtarget:觸摸它後不會調用!
calloutButton = [[UIView alloc] initWithFrame:CGRectMake(left_width2*2-3, 5, 230, 230)];
UIButton *buttongo= [UIButton buttonWithType:UIButtonTypeDetailDisclosure];
buttongo.frame=CGRectMake(0, -1, 25, 25);
[buttongo addTarget:self action:@selector(buttonEvent:) forControlEvents:UIControlEventTouchUpInside];
[calloutButton addSubview:buttongo];
[label addSubview:calloutButton];
-(IBAction)buttonEvent:(id)sender
{
NSLog(@"Hello...");
}
有人知道爲什麼嗎?
謝謝!
我有以下。我認爲是你的意思。 (( - (left_width2 * 2 + 21)/ 2)-21,19 - ANCHOR_Y,100,CALLOUT_HEIGHT)]; label.backgroundColor = [UIColor brownColor]; Brown Color在標籤 – saimonx 2011-02-05 19:23:16