简体   繁体   中英

iOS Design implementation recommandations

I would like to know how to handle, for my iOS app, the following situation:

I have to deal with something like this (basicly this is an article with comments, received from a server):

=- Text and Images -=
=- UIWebView -=
=- List of Comments -=

Now, I came up with two solutions:

  1. Have the content above the list of comments wrapped in a UIScrollView, and create Views for each and everyone of the comments (don't know many of them could be), and

  2. Make the list of comments a UITableView, and the above content its Header.

Which of these (or possibly another if you have any recommandations) should I choose? It may look not very important, but I would like to know this, so I could use the idea in further developing.

If you want something like facebook, so that the context + comments both are movable,then go with option 2.
But, if you want content always at the top, go with option 1.

Indeed, UITableView is a subclass of UIScrollView.

And If you think you might have many comments like (50+),
If you use scrollView, then you should have to supply scrollView with those number of UIView objects.
But, if you use tableView, it perfectly reused already created views.So evenhough you have 1000+ comments, it just uses 5 UIView objects

I would use a UITableView with a custom UITableViewCell wich holds the comments.

It will definitely have a better performance the UITableView than the UIScrollView since the UITableView re-uses the cells.

Using a UITableView you will just have to worry about customising the cells for the comments. Otherwise if you want to use the UIScrollView in case you have a lot of comments you will have to create manually a way to reuse them which is what the UITableView does.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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