我需要創建一個分組的tableview控制器類似this image的UITableView添加分組風格和添加段
我已經確定,這tableview中有2段的一些事情,所以我說2段和2個排,每排各段。
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
if(section == 0) return 2;
else return 2;
}
1.)我遇到的問題是,如何將標籤添加到tableview的第一部分的頂部。
我必須在2組之間添加2個按鈕(tableviews),我知道如何添加一個按鈕,但是如何添加2?
- (UIView *)tableView:(UITableView *)tableView viewForFooterInSection:(NSInteger)section {
if (section == 0) {
UIButton *button = [UIButton buttonWithType:UIButtonTypeRoundedRect];
[button setTitle:@"Hello" forState:UIControlStateNormal];
// How to add the 2nd button ?
return button;
}
return nil;
}
3)當我用2段加分組表視圖,我沒有得到在細胞中的圓邊,我怎麼得到的?
4.)我需要編輯功能(所以我可以刪除記錄)只有第二部分。所以當我點擊編輯按鈕時,我應該只能刪除第二段上的記錄。這可能嗎 ?如果是這樣,我該怎麼做?
這裏是類參考,按ctrl + f鍵入分組,然後按回車鍵。你會看到桌子上的一些文件... http://developer.apple.com/library/ios/#documentation/uikit/reference/UITableView_Class/Reference/Reference.html – Gabe 2011-12-20 16:53:12
你的答案是沒有幫助的。無論如何,謝謝你,我已經瀏覽過它! – Illep 2011-12-20 16:56:22
@lllep這就是爲什麼它是一個評論,而不是答案^ _^ – Gabe 2011-12-20 16:57:17