MonoTouch.Dialog简介
新建一个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简介的更多相关文章
- 使用MonoTouch.Dialog简化iOS界面开发
MonoTouch.Dialog简称MT.D,是Xamarin.iOS的一个RAD工具包.它提供易于使用的声明式API,不需要使用导航控制器.表格等ViewController来定义复杂的应用程序UI ...
- 简化MonoTouch.Dialog的使用
读了一位园友写的使用MonoTouch.Dialog简化iOS界面开发,我来做个补充: 相信使用过DialogViewController(以下简称DVC)的同学都知道它的强大,但是缺点也是明显的,应 ...
- jQuery dialog 简介
dialog是jQuery UI 库的一个UI组件,所以使用dialog时,不仅要引入jQuery.js(因为它只是轻量级的基础框架),还需要引入jQueryUI的js及相关css文件 示例: < ...
- Android Dialogs(1)Dialog简介及Dialog分类
Dialogs A dialog is a small window that prompts the user to make a decision or enter additional info ...
- Dialog 使用详解
极力推荐文章:欢迎收藏 Android 干货分享 阅读五分钟,每日十点,和您一起终身学习,这里是程序员Android 本篇文章主要介绍 Android 开发中的部分知识点,通过阅读本篇文章,您将收获以 ...
- 【Xamarin挖墙脚系列:Mono项目的图标为啥叫Mono】
因为发起人大Boss :Miguel de lcaza 是西班牙人,喜欢猴子.................就跟Hadoop的创始人的闺女喜欢大象一样...................... 历 ...
- mono touch登录设计
需要对MonoTouch.Dialog-1进行引用: using System; using System.Collections.Generic; using System.Linq; using ...
- 3java面试题 传智 发的 有用
第一章内容介绍 20 第二章JavaSE基础 21 一.Java面向对象 21 1. 面向对象都有哪些特性以及你对这些特性的理解 21 2. 访问权限修饰符public.private.protect ...
- 【ABAP系列】SAP abap dialog screen屏幕参数简介
公众号:SAP Technical 本文作者:matinal 原文出处:http://www.cnblogs.com/SAPmatinal/ 原文链接:[ABAP系列]SAP abap dialog ...
随机推荐
- SpringBoot使用Junit4单元测试
SpringBoot2.0笔记 本篇介绍Springboot单元测试的一些基本操作,有人说一个合格的程序员必须熟练使用单元测试,接下来我们一起在Springboot项目中整合Junit4单元测试. 本 ...
- 聊聊 Spring Boot 2.0 的 WebFlux
聊聊 Spring Boot 2.0 的 WebFlux## 前言 对照下 Spring Web MVC ,Spring Web MVC 是基于 Servlet API 和 Servlet 容器设计的 ...
- 我要好offer之 网络大总结
1. TCP协议的状态机 TCP一共定义了11种状态,这些状态可以使用 netstat 命令查看 @左耳朵耗子 tcp系列教程: 上篇 下篇 2. TCP建立连接3次握手.释放连接4次握手 TCP包头 ...
- one day php. alomost all;
<? namespace Test; use \PhpProject\PhpApp as Other; $u=new Other("ns test"); echo $u-&g ...
- luogu 1355 神秘大三角 判断点和三角形的位置关系 面积法 叉积法
题目链接 题目描述 判断一个点与已知三角形的位置关系. 输入输出格式 输入格式: 前三行:每行一个坐标,表示该三角形的三个顶点 第四行:一个点的坐标,试判断该点与前三个点围成三角形的位置关系 (详见样 ...
- 【Visual Studio】error LNK2038: 检测到“_MSC_VER”的不匹配项: 值“1600”不匹配值“1800” (转)
1.案例一 _MSC_VER 定义编译器的版本.下面是一些编译器版本的_MSC_VER值:MS VC++ 10.0 _MSC_VER = 1600MS VC++ 9.0 _MSC_VER = 1500 ...
- 转 Python爬虫入门七之正则表达式
静觅 » Python爬虫入门七之正则表达式 1.了解正则表达式 正则表达式是对字符串操作的一种逻辑公式,就是用事先定义好的一些特定字符.及这些特定字符的组合,组成一个“规则字符串”,这个“规则字符串 ...
- poj 3614(网络流)
Sunscreen Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 6672 Accepted: 2348 Descrip ...
- python,django,mysql学习之环境安装配置
参考:https://docs.djangoproject.com/en/1.6/intro/tutorial01/ http://rainyang.blog.51cto.com/469543/115 ...
- 模块化开发(seajs)
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/ ...