热门标签 | HotTags
当前位置:  开发笔记 > 编程语言 > 正文

设计小视图的最佳做法,例如获取背景资料-Bestpracticetodesignasmallview,e.g.forbackgroundinformation

ImcurrentlyworkingonmyfirstiOSappwhichwillbeavailableontheAppstoresoon(Ihope;-)a

I'm currently working on my first iOS app which will be available on the Appstore soon (I hope ;-) and the project requieres a view with background information. What should display the view? The view should display a icon, opening times and one or two small grouped tables with references two other views with additional information like FAQ or contact informations from the authors.

我正在开发我的第一个iOS应用程序,很快就会在Appstore上提供(我希望;-),该项目需要一个包含背景信息的视图。应该显示什么视图?视图应显示一个图标,打开时间和一个或两个小的分组表,其中包含两个其他视图,其中包含作者的常见问题解答或联系信息等附加信息。

My question is now. What is the best practice to create such kind of view? Is it better too design the view with the Interface Builder and hardcode the strings of the view or should create a UITableView with different Section headers and heights? Where come the content from? plist or so?

我现在的问题是。创建这种视图的最佳做法是什么?是否更好地使用Interface Builder设计视图并对视图的字符串进行硬编码,或者应该创建具有不同Section标题和高度的UITableView?哪里来的内容? plist左右?

I don't know, whats the best practice is and I hope someone can me tell his opinion to solve such a kind of problem.

我不知道,最好的做法是什么,我希望有人可以告诉他的意见来解决这样的问题。

1 个解决方案

#1


0  

It is really a matter of taste and the nature of the data you want to display. I find Interface Builder to be a great tool for setting up the basic layout of a view and try to use it as much as possible.

这真的是一个品味和您想要显示的数据的性质。我发现Interface Builder是一个很好的工具,用于设置视图的基本布局并尝试尽可能多地使用它。

If your data is static and will never change, I see no reason to not just hardcode it in IB or the delegate methods of your UITableViews. On the other hand, if your data is likely to change, or is fetched from a backend, you would be better off setting the text in your UIViewController.

如果您的数据是静态的并且永远不会改变,我认为没有理由不在IB或UITableViews的委托方法中对其进行硬编码。另一方面,如果您的数据可能会更改,或者从后端获取数据,那么最好在UIViewController中设置文本。

Plists are great for holding data that you want to display and they have great support in iOS. If your data will change from time to time, this would be my choice. However, there is really no need for using the extra CPU cycles to parse the plist every time you run the app if the data will never change.

Plists非常适合保存您想要显示的数据,并且在iOS中具有很强的支持。如果您的数据会不时变化,这将是我的选择。但是,如果数据永远不会更改,则每次运行应用程序时都不需要使用额外的CPU周期来解析plist。


推荐阅读
author-avatar
AmenTo_AT
这个家伙很懒,什么也没留下!
PHP1.CN | 中国最专业的PHP中文社区 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved | 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有