新建一个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. 【前端学习笔记】2015-09-09~~~~nodejs中的require()和module.exports

    nodejs中一个js文件就可以看做是一个模块 在node环境中,可以直接var a=require('模块路径以及不带扩展名的模块名') exports---module.exports 其中nod ...

  2. Vue列表渲染,改变数据视图层监测不到的问题

    由于 JavaScript 的限制, Vue 不能检测以下变动的数组: 当你利用索引直接设置一个项时,例如: vm.items[indexOfItem] = newValue 当你修改数组的长度时,例 ...

  3. poj 2724 Purifying Machine

    Purifying Machine Time Limit: 2000MS   Memory Limit: 65536K Total Submissions: 5408   Accepted: 1575 ...

  4. jquery插件的基本写法

    (function($){ var a={name:'2222',age:5555} var b={sex:'男',grade:5555} var c=$.extend({},a,b);//合并到新的 ...

  5. luogu 1355 神秘大三角 判断点和三角形的位置关系 面积法 叉积法

    题目链接 题目描述 判断一个点与已知三角形的位置关系. 输入输出格式 输入格式: 前三行:每行一个坐标,表示该三角形的三个顶点 第四行:一个点的坐标,试判断该点与前三个点围成三角形的位置关系 (详见样 ...

  6. 转 Python执行系统命令的方法

    传送门 Python执行系统命令的方法 http://www.linux-field.com/?p=15 Python中执行系统命令常见方法有两种: 两者均需 import os (1) os.sys ...

  7. YUV和RGB格式分析【转】

    转自:http://www.cnblogs.com/silence-hust/p/4465354.html 做嵌入式项目的时候,涉及到YUV视频格式到RGB图像的转换,虽然之前有接触到RGB到都是基于 ...

  8. NERDTree

    What's NERDTree    :    A tree explorer plugin for vim. Install : Using Vundle on .vimrc " for ...

  9. 遍历删除List中的元素,会报错?

    经常会碰到遍历集合,然后删除里面的对象报错, 纠结半天, 百度了一下,有大神说不能用for-each,  for , 只能用迭代器,真的吗?  我就删成功了呢,看代码,请大神们指正! public s ...

  10. python笔记1:python基础

    1.Python模块的标准文件模板: #!/usr/bin/env python #第1行注释可以让这个 .py 文件直接在Unix/Linux/Mac上运行 # -*- coding: utf-8 ...