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