的鋒網越來越設定我編程方式添加一個按鈕,一個UITableViewController這樣的:按鈕添加到的UITableViewController中的tableView
-(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]
也不起作用。
添加在哪裏ü要添加的按鈕? tableView的頂部或tableView的單元格內? – AppleDelegate
頂部,而不是在一個單元格內 – Eric
什麼是「但它卡在單元格佔用button.frame空間。」意思? – Eiko