iphone uitableview还是uiscrollview更好? [英] iphone uitableview or uiscrollview better?

查看:82
本文介绍了iphone uitableview还是uiscrollview更好?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

关于负面评论,我在一小步骤中简化了我的问题

Regarding on negative commenst here I simplify my question in small steps

我有一个基于视图的应用程序,它与Web服务通信并重新获取xml,解析xml和map它会调用一个合适的视图组件(例如,如果日期显示带有datepicker的问题,如果问题有2个值显示带有分段控件,如果有更多带有pickerview..etc)那么它是一个有很多页面的动态问题。

I have a view based application which communicates with a web service and recives xml, parse xml and map its contens an appropriate view component (e.g if thats a date show the question with datepicker, if question has 2 values show it with a segmented control, if more with a pickerview..etc) so its a dynamic questionary with many pages.

1-App接收XML

1-App Receive XML

2-Parse XML并获得最新未解答的问题(可以无限制)每页的问题数量),每个问题都需要使用文本框或选择器视图或分段控件来询问,具体取决于问题类型,也可能需要一些标签用于说明,验证警报和问题标签。每个问题和标签应该有不同的字体和颜色,用xml定义。

2-Parse XML and get the latest un-answered questions (there can be unlimited number of questions per each page), each question need to be asked with either a textbox or picker view or segmented control depending on the question type, also it may need a few labels for explanition, and validation alerts, and the question label. Each question and label should have different fonts and colors, defined in xml.

3-用户回答页面中的所有问题,然后按发送按钮。

3- User answers all questions inhe page and press send button.

4-Web服务接收,检查答案并根据给出的答案发回新问题。

4-Web service receives, checks the answers and sends back new question(s) to be asked depending on the answers given.

5 -APP接收新的XML(每个XML包括整个状态,即所有以前回答的问题)并解析以找出最新的未答复的问题。

5-APP receives new XML (each XML includes whole the state i.e all the previous answered questions) and parse to find out the latest unanswered questions.

6 - 用户再次回答和发送问题并等待下一组问题直到没有问题要求

6-User again answers and sends the questions and wait for the next set of questions until there are no questions to be asked

7-OR用户可能想要返回并编辑前几页中的一些问题。但如果他编辑了之前页面中的任何问题,那么在该页面之后回答的页面将不再有效,因为每组问题服务器发送取决于先前回答的问题,因此需要从XML中删除所有后续问题并发送回请求好像是等待回复的最新页面。

7-OR user may want to go back and edit some questions in previous pages. BUT if he edits any question in previous pages then the pages answered after that page are not valid anymore, because each set of question server sends depends on the previosly answered questions, so it needs to delete all the later questions from XML and sends back a request as if it was the latest page waiting for a response.

问题:

1 - 我应该使用UiScrollView还是TableView?什么是这里的通用面向对象设计

1-Should I use UiScrollView or TableView? and what is the general object oriented design here

推荐答案

您可以使用它们中的任何一种,具体取决于方案。 tableView默认提供了一个非常好的内存管理模型,但是使用scrollView你需要自己管理内存,管理意味着如果你在scrollView上放置了这么多UI元素,你的应用可能会开始接收内存警告,或者在最坏的情况下可能会崩溃。表单元格的可重用性允许您在不重载内存的情况下放置更多内容,前提是您明智地使用它。您只需要处理自定义tableView单元格即可获得显示问题所需的视图。

You can use any of them, depends on the scenario. The tableView offers a very good memory management model by default but with scrollView you need to manage memory yourself, managing means if you put so many UI elements on the scrollView, your app might start receiving memory warnings or in the worst case can get crashed. The reusability of table cells allows you to put much more content without overloading memory, provided if you use it sensibly. You just need to work on the custom tableView cells to get a view needed to display your questions.

这篇关于iphone uitableview还是uiscrollview更好?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆