如果我直接添加按钮,一切都很顺利。我真的很想将它添加到视图中,仍然可以点击它。这里的代码:在UITableView UIView中的UIButton =无法点击按钮
UIView *containerView =
[[[UIView alloc]
initWithFrame:CGRectMake(0, 0, 300, 60)]
autorelease];
UIButton *footerButton = [UIButton buttonWithType:UIButtonTypeCustom];
footerButton.frame = CGRectMake(10, 10, 300, 40);
[footerButton addTarget:self action:@selector(click) forControlEvents:UIControlEventTouchUpInside];
[containerView addSubview:footerButton];
如何使用'containerView'?你做'[tableView addSubview:containerView]',或者在表格视图单元格中使用它?您应该尝试使用UIButtonTypeRoundedRect并查看它是否正在进行交互。 – tia 2010-10-15 03:27:33
我在页脚中使用 – gurghet 2010-10-15 12:56:30