有人使用 MonoTouch 实现了 StackPanel 等效项吗?

发布于 2025-01-02 05:10:04 字数 296 浏览 3 评论 0原文

当使用 MonoTouch 为 iOS 编写等效 UI 时,我怀念 WPF / Silverlight 的自动布局控件(如 StackPanel 和 Grid)。

我希望有人已经创建了这些,而不是重新发明轮子:-)

我找到了一个 stackpanel 对于 iOS github 项目,但作为 MonoTouch 的新手,我不确定如何将 Obj-C 代码集成到 Mono 项目中。

I miss WPF / Silverlight's auto-layout controls (like StackPanel and Grid) when writing the equivalent UI for iOS using MonoTouch.

I'm hoping that instead of reinventing the wheel, someone has already created these :-)

I've found a stackpanel for iOS github project but being a newbie to MonoTouch, I'm not sure how I would integrate the Obj-C code into the Mono project.

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

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

发布评论

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

评论(1

木格 2025-01-09 05:10:04

我找到了 iOS github 项目的堆栈面板

stackpanel 代码似乎基于 UITableView 并为特定情况提供了更简单的 API。

我不确定如何集成 Obj-C 代码

一般来说,您可以将现有的 Objective-C 编译到库中(使用 Xcode)和 为其创建托管绑定。然而,在这种情况下,代码看起来相当小,因此甚至可能更容易转换为 C#(并提供更接近 Silverlight 的 StackPanel 的 API)。

但我强烈建议您查看 MonoTouch.Dialog 它为您提供了更简单的表格 API,包括支持所有者绘制的元素。它也很容易扩展(使用 C#)来创建您自己的元素。请参阅示例项目以了解它们的实际效果。

I've found a stackpanel for iOS github project

The stackpanel code seems based on UITableView and offers a simpler API for a specific case.

I'm not sure how I would integrate the Obj-C code

In general you can compile existing objective-c into a library (using Xcode) and create managed bindings for it. However in this case the code looks quite small so it might even be easier to translate to C# (and provide an API closer to Silverlight's StackPanel).

But I strongly suggest you to look at MonoTouch.Dialog which offers you a simpler API for tables, including support for owner-drawn elements. It's also very easy to extend (using C#) to create your own elements. See the Sample project to see them in action.

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