新建一个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. 关于scarpy的一些说明

    一  scrapy添加代理 1 内置代理:os.environ. 固定格式,不推荐 os.environ['http_proxy'] = "http://root:woshiniba@192 ...

  2. Road(bzoj 2750)

    Description C国有n座城市,城市之间通过m条单向道路连接.一条路径被称为最短路,当且仅当不存在从它的起点到终点的另外一条路径总长度比它小.两条最短路不同,当且仅当它们包含的道路序列不同.我 ...

  3. 洛谷 [P3629] 巡逻

    树的直径 树的直径有两种求法 1.两遍 dfs 法, 便于输出具体方案,但是无法处理负权边 2.DP 法,代码量少,可以处理负权边 #include <iostream> #include ...

  4. 一款基于bootstrap的文件上传插件,现在很多手机webapp都在用

    官网:http://plugins.krajee.com/file-input

  5. 标准C程序设计七---60

    Linux应用             编程深入            语言编程 标准C程序设计七---经典C11程序设计    以下内容为阅读:    <标准C程序设计>(第7版) 作者 ...

  6. js、jq平时积累

    1.window.onbeforeunload   =   function(){$(window).scrollTop(0);}  //在即将离开当前页面(刷新或关闭)时执行 JavaScript ...

  7. Codeforces 375D Tree and Queries(DFS序+莫队+树状数组)

    题目链接  Tree and Queries 题目大意  给出一棵树和每个节点的颜色.每次询问$vj, kj$ 你需要回答在以$vj$为根的子树中满足条件的的颜色数目, 条件:具有该颜色的节点数量至少 ...

  8. tr命令用法

    原文链接 # echo "abcd"|tr 'a' 'b' bbcd tr 命令 用途 转换字符. 语法 tr [ -c | -cds | -cs | -C | -Cds | -C ...

  9. jenkins发布普通项目、配置自动上线自动部署

    1.以root用户运行jenkins是不专业的 刚开始用jenkins时用jenkins这个普通用户运行程序,始终无法连接到gitlab,报错如下: 先是把修改jenkins上的git路径,将git修 ...

  10. 济南day3

    连续几天都有点炸 预计的分拿不到,调整好心态,考试的时候多想一下,think twice,code once 唉,什么情况啊 题解链接 0+0+0 T1读错题输出反了 n*m%2判断是否==1 T2 ...