开发者

iPhone SDK Simple Question

开发者 https://www.devze.com 2023-01-11 23:00 出处:网络
Is it possible to add a UIActivityIndicatorView to the left side of a UITableViewCell?We\'re already using the right side of a UITableViewCell for 开发者_如何转开发a disclosure indicator.

Is it possible to add a UIActivityIndicatorView to the left side of a UITableViewCell? We're already using the right side of a UITableViewCell for 开发者_如何转开发a disclosure indicator.

Thanks.


Sure. Just instantiate a UIActivityIndicatorView, give it a .frame that sets it where you want it, add it as a subview of cell.contentView, and call startAnimating.

UIActivityIndicatorView *spinner = [[UIActivityIndicatorView alloc] 
    initWithFrame:CGRectMake(0,0,20,20)]; //or whatever--this will put it in the top left corner of the cell
[cell.contentView addSubview:spinner]
[spinner startAnimating];
[spinner release];


If you create a custom cell, you can do anything you want. But this document here from Apple should give you all you need whether just adding subviews to a regular old UITableViewCell or creating your own.

0

精彩评论

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