繁体   English   中英

iPhone SDK简单问题

[英]iPhone SDK Simple Question

是否可以在UITableViewCell的左侧添加UIActivityIndi​​catorView? 我们已经在使用UITableViewCell的右侧作为公开指示器。

谢谢。

当然。 只需实例化一个UIActivityIndi​​catorView,为其提供一个.frame即可将其设置在所需位置,将其添加为cell.contentView的子视图,然后调用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];

如果创建自定义单元,则可以执行任何操作。 但是,Apple提供的这份文档应该为您提供所有所需的条件,无论是将子视图添加到常规的旧UITableViewCell还是创建自己的子视图。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM