简体   繁体   English

UIScrollView或UITableView?

[英]UIScrollView or UITableView?

I have a chat app which needs to save history (similar to the native SMS app). 我有一个聊天应用程序需要保存历史记录(类似于本机SMS应用程序)。

Currently I'm using a UIWebView but due to performances issues, I want to switch to native controls. 当前,我正在使用UIWebView,但是由于性能问题,我想切换到本机控件。

The easier way would be to use a UIScrollView and just add a custom UIView for every bubble, but I'm not sure how will it work for long conversations. 更简单的方法是使用UIScrollView并为每个气泡添加自定义UIView,但是我不确定长时间的对话将如何工作。

Assuming I have a long history, will UIScorllView perform well? 假设我的历史悠久,UIScorllView的效果会很好吗? My other option is to use a UITableView but it's an additional overhead. 我的另一个选择是使用UITableView,但这是额外的开销。

I should use a UITableView with a custom UITableViewCell wich holds the bubble. 我应该使用带有自定义UITableViewCell的UITableView,它可以容纳气泡。

Something similar is done in this sample project taken from this tutorial 在本教程中获得的这个示例项目中也做了类似的操作

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

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