我以编程方式向 UITableViewController 添加一个按钮,如下所示:
-(void)createFlipButton
{
UIButton *button = [UIButton buttonWithType:UIButtonTypeInfoDark];
button.frame = CGRectMake(282, 372, 18, 19);
[button addTarget:self action:@selector(flipView) forControlEvents:UIControlEventTouchDown];
[self.view addSubview:button];
[self.view bringSubviewToFront:button];
}
但它卡在占据 button.frame 空间的单元格中。为什么不 [self.view bringSubviewToFront:button]
工作?
此外, [self.tableView bringSubviewToFront:button]
也不起作用。