0
UIButton * button; 我已經把cell.accessoryView =按鈕;與UITabelview單元相關的問題
在didSelectRowAtIndexPath方法我已經寫了上面的代碼,但它不會對UITabelView
UIButton * button; 我已經把cell.accessoryView =按鈕;與UITabelview單元相關的問題
在didSelectRowAtIndexPath方法我已經寫了上面的代碼,但它不會對UITabelView
的細胞表現出的UIButton你需要把這個委託方法-tableView:cellForRowAtIndexPath:
,對於表視圖初始化並返回細胞:
- (UITableViewCell *) tableView:(UITableView *)tv cellForRowAtIndexPath:(NSIndexPath *)indexPath {
// initialize cell and contents here, for the specified indexPath value
}
您可能想要閱讀Table View Programming Guide for iPhone OS,這將詳細解釋這一點。