iPhone SDK 简单问题

发布于 2024-09-14 19:01:48 字数 109 浏览 3 评论 0原文

是否可以将 UIActivityIndi​​catorView 添加到 UITableViewCell 的左侧?我们已经使用 UITableViewCell 的右侧作为披露指示器。

谢谢。

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.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

云醉月微眠 2024-09-21 19:01:48

当然。只需实例化一个 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];

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];
断念 2024-09-21 19:01:48

如果您创建自定义单元格,您可以执行任何您想要的操作。但是 Apple 的此文档 应该可以为您提供所需的一切,无论是向常规旧 UITableViewCell 添加子视图还是创建自己的子视图。

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文