新建一个Single View Application项目

添加程序集 MonoTouch.Dialog.dll引用

删除 MainStoryboard.storyboard

添加空类Task.cs

using System;

namespace APITest
{
public class Task
{
public Task ()
{
}
public string Name { get; set; } public string Description { get; set; } public DateTime DueDate { get; set; }
}
}

  

在AppDelegate.cs中重写方法FinishedLaunching,改为如下代码

using System;
using System.Linq;
using System.Collections.Generic; using Foundation;
using UIKit;
using MonoTouch.Dialog; namespace APITest
{
// The UIApplicationDelegate for the application. This class is responsible for launching the
// User Interface of the application, as well as listening (and optionally responding) to
// application events from iOS.
[Register ("AppDelegate")]
public partial class AppDelegate : UIApplicationDelegate
{
// class-level declarations
UIWindow _window;
RootElement _rootElement;
DialogViewController _rootVC;
UINavigationController _nav;
UIBarButtonItem _addButton;
int n=0;
public override UIWindow Window {
get;
set;
}
public override bool FinishedLaunching (UIApplication app, NSDictionary options)
{
_window = new UIWindow (UIScreen.MainScreen.Bounds);
_rootElement = new RootElement ("To Do List"){ new Section()};
_addButton = new UIBarButtonItem (UIBarButtonSystemItem.Add);
_addButton.Clicked+= (sender, e) => {
++n;
var task=new Task{ Name="task"+n , DueDate=DateTime.Now };
var taskElement=new RootElement(task.Name){
new Section(task.Name){new EntryElement(task.Name,"Enter Task Description",task.Description)},
new Section(task.Name){new DateTimeElement("DueDate", task.DueDate)}
};
_rootElement[0].Add(taskElement);
};
_rootVC = new DialogViewController (_rootElement);
_nav = new UINavigationController (_rootVC);
_rootVC.NavigationItem.RightBarButtonItem = _addButton;
_window.RootViewController = _nav;
_window.MakeKeyAndVisible ();
return true;
}
// This method is invoked when the application is about to move from active to inactive state.
// OpenGL applications should use this method to pause.
public override void OnResignActivation (UIApplication application)
{
} // This method should be used to release shared resources and it should store the application state.
// If your application supports background exection this method is called instead of WillTerminate
// when the user quits.
public override void DidEnterBackground (UIApplication application)
{
} // This method is called as part of the transiton from background to active state.
public override void WillEnterForeground (UIApplication application)
{
} // This method is called when the application is about to terminate. Save data, if needed.
public override void WillTerminate (UIApplication application)
{
}
}
}

  双击Info.plist

运行结果

MonoTouch.Dialog简介的更多相关文章

  1. 使用MonoTouch.Dialog简化iOS界面开发

    MonoTouch.Dialog简称MT.D,是Xamarin.iOS的一个RAD工具包.它提供易于使用的声明式API,不需要使用导航控制器.表格等ViewController来定义复杂的应用程序UI ...

  2. 简化MonoTouch.Dialog的使用

    读了一位园友写的使用MonoTouch.Dialog简化iOS界面开发,我来做个补充: 相信使用过DialogViewController(以下简称DVC)的同学都知道它的强大,但是缺点也是明显的,应 ...

  3. jQuery dialog 简介

    dialog是jQuery UI 库的一个UI组件,所以使用dialog时,不仅要引入jQuery.js(因为它只是轻量级的基础框架),还需要引入jQueryUI的js及相关css文件 示例: < ...

  4. Android Dialogs(1)Dialog简介及Dialog分类

    Dialogs A dialog is a small window that prompts the user to make a decision or enter additional info ...

  5. Dialog 使用详解

    极力推荐文章:欢迎收藏 Android 干货分享 阅读五分钟,每日十点,和您一起终身学习,这里是程序员Android 本篇文章主要介绍 Android 开发中的部分知识点,通过阅读本篇文章,您将收获以 ...

  6. 【Xamarin挖墙脚系列:Mono项目的图标为啥叫Mono】

    因为发起人大Boss :Miguel de lcaza 是西班牙人,喜欢猴子.................就跟Hadoop的创始人的闺女喜欢大象一样...................... 历 ...

  7. mono touch登录设计

    需要对MonoTouch.Dialog-1进行引用: using System; using System.Collections.Generic; using System.Linq; using ...

  8. 3java面试题 传智 发的 有用

    第一章内容介绍 20 第二章JavaSE基础 21 一.Java面向对象 21 1. 面向对象都有哪些特性以及你对这些特性的理解 21 2. 访问权限修饰符public.private.protect ...

  9. 【ABAP系列】SAP abap dialog screen屏幕参数简介

    公众号:SAP Technical 本文作者:matinal 原文出处:http://www.cnblogs.com/SAPmatinal/ 原文链接:[ABAP系列]SAP abap dialog ...

随机推荐

  1. 表单编码 appliation/x-www-form-urlencoded 与 multipart/form-data 的区别

    当表单使用POST方法时,表单数据提交到服务器端之前有两种编码类型可供选择.默认编码类型为 application/x-www-form-urlencoded,此时所有非字母数字类型的字符都需要转换为 ...

  2. Xode 8 的那些坑

    刚发布完Xcode的8.0果断更新了,发现用起来非常容易闪退,关键是我编辑项目时默认使用Xcode8打开,导致我用Xcode7打开Xib是报错: This version does not suppo ...

  3. stein法求gcd 学习笔记

    原理显然 由于当x,y都为奇数时进行辗转相见 每次减完必有偶数 而偶数最多除log次 那么也最多减log次 复杂度有保证 注:代码未验证 int gcd(int x,int y){ int res=1 ...

  4. Blog 081018

    对于 linux 系统 api, 尝试理解函数参数和函数之间的内在联系,为什么要用这些参数而不是另一些参数,了解 api 之间的一些共性. 一个扩展性良好的程序,结构都有一些共性,就像是一个国家,有好 ...

  5. 【BZOJ3524】Couriers(主席树)

    题意:给一个长度为n的序列a.1≤a[i]≤n.m组询问,每次询问一个区间[l,r],是否存在一个数在[l,r]中出现的次数大于(r-l+1)/2.如果存在,输出这个数,否则输出0. n,m≤5000 ...

  6. yii使用bootstrap分页样式

    Bootstrap是Twitter推出的一个开源的用于前端开发的工具包.它由Twitter的设计师Mark Otto和Jacob Thornton合作开发,是一个CSS/HTML框架.Bootstra ...

  7. AC日记——[HAOI2015]树上操作 洛谷 P3178

    题目描述 有一棵点数为 N 的树,以点 1 为根,且树点有边权.然后有 M 个操作,分为三种:操作 1 :把某个节点 x 的点权增加 a .操作 2 :把某个节点 x 为根的子树中所有点的点权都增加 ...

  8. BZOJ3270 博物館 概率DP 高斯消元

    BZOJ3270 博物館 概率DP 高斯消元 @(XSY)[概率DP, 高斯消元] Description 有一天Petya和他的朋友Vasya在进行他们众多旅行中的一次旅行,他们决定去参观一座城堡博 ...

  9. Css Position定位(简易版本)

    准备前的知识: 定位只对块级起作用.如div,p等元素是块级元素,如果是内联元素则可以先变成块级元素,display:block即可. 开始讲解: 定位共四种:static,fixed,relativ ...

  10. 好用的Python IDLE Sublime Text 3推荐

    Sublime Text 3 下载地址为 LINK, Sublime Text 3 is currently in beta. The latest build is 3114. 参考的激活方式为输入 ...