c# - Monotouch.Dialog 两个表

标签 c# iphone ios xamarin.ios monotouch.dialog

我是 MonoTouch 的新手。
我需要使用 monotouch.dialog 在 1 个 View 中显示 2 个表格和它们之间的按钮.
它应该看起来像

---top of screen---
I BoolElement     I
I StringElement   I
I StringElement   I          <--- Yeah,yeah this is iPhone(in my Opinion)
I --empty space-- I
I button          I
I --empty space-- I
I StringElement   I
---End Of screen--

我在互联网上搜索过 - 但找不到类似的东西。 :(
问题是显示最后一个 srigElement

最佳答案

使用 MonoTouch.Dialog,您可以使用以下内容:

    RootElement CreateRoot ()
    {
        var btn = new UIButton ();
        btn.TouchUpInside += delegate {
            Console.WriteLine ("touch'ed");
        };
        // TODO: customize button look to your liking
        // otherwise it will look like a text label
        btn.SetTitle ("button", UIControlState.Normal);
        Section s = new Section ();
        s.HeaderView = btn;
        return new RootElement (String.Empty) {
            new Section () {
                new BooleanElement ("bool", false),
                new StringElement ("s1"),
                new StringElement ("s2"),
                },
            new Section (),
            s,
            new Section () {
                new StringElement ("s3"),
            },
        };      
    }

这将使用 Section添加 UIButton里面HeaderView .相同的技巧可用于添加任何其他类型的控件。

关于c# - Monotouch.Dialog 两个表,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8296548/

相关文章:

c# - ASMX Web 服务的基类 - 从基类本身调用派生方法

c# - C# 中字符串情况下引用类型和值类型的区别

c# - 如何在 AngleSharp 中解析来自匿名 block 的文本?

iphone - 在多个 UIWebViews 中不记得网站登录

iphone - iPhone 4 上的 UITableViewCell 随机消失 + 滚动性能问题

c# - 为什么将 "Change Tracking of fields"添加到 Dapper 是好主意还是坏主意?

iphone - 从 char * 获取 NSString(转换 C 的字符指针)

iphone - MKAnnotationView 图像不显示

ios - 为什么我在不同的应用程序中得到不同的Locale.current?

ios - swift 如何使用 Controller 从本地设备中选取文件