MonoTouch - XIB 还是不 XIB?

发布于 2024-09-14 13:49:25 字数 360 浏览 9 评论 0原文

我正在决定使用 MonoTouch 进​​行开发时需要在何处使用 .xib 文件。

我当前的项目需要与 iPhone 和 iPad 配合使用,所以我想知道使用 Interface Builder 是否值得。我已经必须删除一些设计器文件,以便 2 个不同的视图(每个设备一个)转到同一个控制器。我也是唯一一个在这方面工作的人,IB里不会有设计师在工作。

这里有几个问题:

  • 使用 XIB 是否会提高/降低性能?
  • 是否存在任何软件设计问题,有损 MVC 等,以某种方式或另一种方式会阻止?
  • 使用 XIB 是否存在任何通用性缺点,例如使用 XIB 对某些视图实现延迟加载是否困难?

想法?

I am deciding on where using .xib files are needed while developing with MonoTouch.

My current project needs to work with iPhone and iPad, so I'm wondering if even using Interface Builder is worth it. I already have to remove some designer files so that 2 different views (one for each device) go to the same controller. I also am the only one working on this, and there will be no designer working in IB.

Here are a couple questions:

  • Is there any performance benefit/decrease to using XIBs?
  • Is there any software design issues, detracting from MVC, etc. that one way or the other will inihibit?
  • Is there any versatility drawbacks to using XIBs, like is it tough to implement lazy-loading for certain views with XIBs?

Thoughts?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

财迷小姐 2024-09-21 13:49:25

我最近不得不做出同样的决定,我决定少去xib。我发现更容易准确地看到何时发生了什么。

由于 iPhone 和 iPad 界面相对简单,我并没有从 IB 中获得巨大的好处,但是 MonoDevelop 和 IB 之间有很多跳跃。和你一样,我没有直接与设计师合作。

我在 IB 中进行初始布局以获取坐标。之后我就直接在代码中进行修改即可。

文件较少还有一个好处。

另一个优势是提问。通过电子邮件向同事发送代码块比代码和 xib 文件要容易得多。我还可以轻松地添加需要简洁地指定问题的核心代码。

至于你的问题...我发现当我完全控制时,根据 MVC 思考和构建我的项目会更容易 - 但也许这只是我的情况。对于我的项目,我并没有真正找到我认为 xib 文件会更好的地方。至于性能,我没有做过任何测试,所以不能真正提供明智的意见。我在某处读到一篇文章,其中的差异可以忽略不计,但快速搜索并没有发现它。今晚我会尝试找到它。

I just recently had to make the same decision, and I decided to go xib-less. I found it easier to be able to see exactly what was happening when.

With the iPhone and iPad interfaces being relatively simple, I wasn't getting a huge benefit from IB, but there was a lot of jumping around between MonoDevelop and IB. Like you, I wasn't working directly with designers.

I do the initial layout in IB to get the coordinates. After that, I just do modifications directly in the code.

There's also the benefit of having less files.

Another advantage was in asking questions. It's much easier to email colleagues chunks of code, than code and xib files. I can also easily extra the core code need to specify the question succinctly.

As to your questions... I found it easier to think about and structure my project according to MVC when I was in complete control - but maybe that's just me. For my project, I didn't really find something where I thought a xib file would have been much better. As for performance, I've not done any tests, so can't really offer an informed opinion on that. I read a post somewhere that the difference was negligible, but a quick search hasn't dug it up. I'll try and locate it tonight.

樱娆 2024-09-21 13:49:25

我们去的xib较少,没有xib的视图似乎性能更好。我发现 Apple 对 MVC 的解释令人困惑。

We went xib less and the views where there are no xibs seem to be more performant. I find Apples interpretation of MVC confusing.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文