简体   繁体   English

在iPhone中创建供稿页面的最佳方法是什么?

[英]What's the best way to create a feed page in iPhone?

I want to create a feed page in my iPhone application and the functionality is very similar to the Newsfeed in Facebook with the only difference being the comments and likes are shown on the same feed page itself rather than navigating to a different view in Facebook. 我想在我的iPhone应用程序中创建一个供稿页面,其功能与Facebook中的Newsfeed非常相似,唯一的区别是评论和点赞显示在同一供稿页面上,而不是导航至Facebook中的其他视图。

Constraints / Challenges 约束/挑战

1.In my Feed page, I have a set of 1.在Feed页面中,我有一组

{ {

[Feed item card] [进料卡]

[a Comment / Like Card] [评论/赞卡]

}, },

{ {

[Feed item card] [进料卡]

[a Comment / Like Card] [评论/赞卡]

} }

2.There is another challenge where the comments are shown using ellipsis if it's longer and the user has to tap on the comment to expand it and view it completely. 2.另一个挑战是,如果注释较长,则用省略号显示注释,用户必须点击注释以展开并完整查看。 When you tap to expand all the below rows (including next feed card) should position accordingly. 当您点击展开时,以下所有行(包括下一张Feed卡)都应相应定位。

3.Height of feed card alone is 353px and the height of the comment card is variable based on the number of comments and their length. 3.单独的Feed卡的高度为353px,注释卡的高度根据注释的数量和长度而变化。

I implemented this using UITableViewController where each row will have a {feed card and comment card} and it's working perfectly fine and however I have a question and a problem. 我使用UITableViewController实现了这一点,其中每行将有一个{feed card and comment card},并且工作得很好,但是我有一个问题。

Question

1.Am I using the right approach here ? 1.我在这里使用正确的方法吗? When the user scrolls down, I'm supposed to load more records from the server / core data and put them below. 当用户向下滚动时,我应该从服务器/核心数据中加载更多记录并将其放在下面。 Will there be any performance bottlenecks if I have more than say 200 entries esp since the row height is always > 500px? 如果行数始终大于500像素,尤其是我有200多个条目,是否会有性能瓶颈?

Problem 问题

2.Say I have 5 records on the page and when I scroll down the table view is not painting the next {feed card and the comment card row} for a few seconds and then it suddenly appears. 2.说我在页面上有5条记录,当我向下滚动表格视图时,几秒钟没有绘制下一个{供稿卡和注释卡行},然后突然出现。 I have used Table views in several other projects but never seen a similar behavior which triggered the previous question. 我在其他几个项目中使用过Table视图,但是从未见过类似的行为触发了上一个问题。

Is there another approach rather than using UITableView ? 是否有另一种方法而不是使用UITableView?

Thanks 谢谢

If the table view cell is larger than the screen this can lead to performance issues during scrolling. 如果表格视图单元格大于屏幕,则可能导致滚动过程中的性能问题。 I would strongly recommend to make the cells smaller. 我强烈建议使细胞更小。 Maybe you can split the info in several cells. 也许您可以将信息分成几个单元格。

To the problem: Do you reload the table view on a thread which is not the main thread? 问题所在:您是否在不是主线程的线程上重新加载了表格视图? The UI always have to be refreshed on the main thread. UI始终必须在主线程上刷新。

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

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