开发者

A question related to cell of UITabelview

开发者 https://www.devze.com 2022-12-27 23:03 出处:网络
UIButton * butt开发者_如何学JAVAon; I have put cell.accessoryView = button; In didSelectRowAtIndexPath i have written above code,but it doesn\'t show UIButton on cell of UITabelViewYou need to put th

UIButton * butt开发者_如何学JAVAon; I have put cell.accessoryView = button;

In didSelectRowAtIndexPath i have written above code,but it doesn't show UIButton on cell of UITabelView


You need to put this in the delegate method -tableView:cellForRowAtIndexPath: that initializes and returns cells for the table view:

- (UITableViewCell *) tableView:(UITableView *)tv cellForRowAtIndexPath:(NSIndexPath *)indexPath {
    // initialize cell and contents here, for the specified indexPath value
}

You might want to read the Table View Programming Guide for iPhone OS, which explains this in detail.

0

精彩评论

暂无评论...
验证码 换一张
取 消