Monotouch:构建一个“控制台”?
我正在构建一个客户端/服务器应用程序。服务器向我发送了大量信息,我需要在 iPhone 上的“控制台”中显示这些信息。我需要显示几列(时间、用户、消息)。
对此最好的方法是什么?
我考虑过创建一个 UIWebView 并创建一个表..但是我能够在信息来自服务器时添加行吗?我可以连接到 UIWebView 中的表并时不时添加新行吗?
我应该使用 UITableView 构建它吗?
你会怎么办?
谢谢!!!
莫乔
I'm building a client/server app. The server sends me lots of information, that I need to display on the iPhone in a "console". I need to display several of columns (time, user, message).
What is the best approach for this?
I thought about creating a UIWebView and create a table .. but will I be able to add rows as information comes from the server? Can I hook into a table in the UIWebView and add a new row now and then?
Should I build it using a UITableView?
What would you do?
Thanks!!!
Mojo
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我会使用
UITableViewController
并创建一个TableDataSource
来从服务器读取行。您可以设置行格式或使用自定义控件(我通常使用自定义行控件)。
希望这有帮助。
I would have used a
UITableViewController
and create aTableDataSource
which would read the rows from the server.You can either format the row or use a custom control for it (I usually use custom row control).
Hope this helps.
我不知道您的 UI 需要有多复杂,但如果基本外观就足够了,为什么不简单地使用
UITextView
并使用选项卡对其进行格式化?然后,您可以在收到文本时继续附加文本。
为了防止用户乱搞,只需将
UserInteractionEnabled
设置为false
即可。I don't know how sophisticated your UI needs to be but if the basic look is enough, why not simply use a
UITextView
and format it using tabs?You can then keep on appending text as you receive it.
To prevent the user from messing around with it, just set
UserInteractionEnabled
tofalse
.