需要对MonoTouch.Dialog-1进行引用;

using System;
using System.Collections.Generic;
using System.Linq; using MonoTouch.Foundation;
using MonoTouch.UIKit;
using MonoTouch.Dialog;
using System.Diagnostics; namespace MTDLoginDemo
{
[Register ("AppDelegate")]
public partial class AppDelegate : UIApplicationDelegate
{
// class-level declarations
UIWindow window;
EntryElement login, password; public override bool FinishedLaunching (UIApplication app, NSDictionary options)
{
window = new UIWindow (UIScreen.MainScreen.Bounds); window.RootViewController = new DialogViewController (new RootElement ("Login") {
new Section ("用户登录"){
(login = new EntryElement ("用户名", "输入用户名", "")),
(password = new EntryElement ("密码", "用户密码", "", true))
},
new Section ("caption1231","footer123131221321") {
new StringElement ("登录", delegate{
Alert(login.Value+" " +password.Value);
})
}
}); window.MakeKeyAndVisible (); return true;
} private void Alert(string msg)
{
UIAlertView av = new UIAlertView ("提示", msg, null, "确定", null);
av.Show ();
}
}
}

效果图: 这里需要指出的是 Section有5个重载,可以自行试验一下,uiview相当于在上面或下面添加uiview对象的具体实例

================分割线==================

using System;
using System.Collections.Generic;
using System.Linq; using MonoTouch.Foundation;
using MonoTouch.UIKit;
using MonoTouch.Dialog;
using System.Diagnostics; namespace MTDLoginDemo
{
[Register ("AppDelegate")]
public partial class AppDelegate : UIApplicationDelegate
{
// class-level declarations
UIWindow window;
EntryElement login, password; public override bool FinishedLaunching (UIApplication app, NSDictionary options)
{
window = new UIWindow (UIScreen.MainScreen.Bounds); window.RootViewController = new DialogViewController (new RootElement ("Login") {
new Section (){
(login = new EntryElement ("用户名", "输入用户名", "")),
(password = new EntryElement ("密码", "用户密码", "", true))
},
new Section () {
// new StringElement ("登录", delegate{
// Alert(login.Value+" " +password.Value);
// })
new UIViewElement("fdsf",CreateBtn(),true)
}
}); window.MakeKeyAndVisible ();
return true;
} private UIButton CreateBtn()
{
UIButton btn = new UIButton (UIButtonType.RoundedRect);
btn.Frame = new System.Drawing.RectangleF (0, 0, 300, 35);
btn.SetTitle ("登录", UIControlState.Normal);
btn.TouchUpInside += delegate {
Alert (login.Value + " " + password.Value);
// detail login methord...
};
return btn;
} private void Alert(string msg)
{
UIAlertView av = new UIAlertView ("提示", msg, null, "确定", null);
av.Show ();
}
}
}

mono touch登录设计的更多相关文章

  1. RESTful登录设计(基于Spring及Redis的Token鉴权)

    转载自:http://www.scienjus.com/restful-token-authorization/ http://m.blog.csdn.net/article/details?id=4 ...

  2. struts2的记住账号密码的登录设计

    一个简单的基于struts2的登录功能,实现的额外功能有记住账号密码,登录错误提示.这里写上我在设计时的思路流程,希望大家能给点建设性的意见,帮助我改善设计. 登录功能的制作,首先将jsp界面搭建出来 ...

  3. 《iPhone高级编程—使用Mono Touch和.NET/C#》

    第1章 C#开发人员基于MonoTouch进行iPhone开发概述 1 1.1 产品对比 2 1.1.1 .NET Framework 2 1.1.2 Mono 2 1.1.3 MonoTouch 3 ...

  4. Decoration7:注册登录设计

    首先顶一个小目标:从前台写入用户数据后,登录的时候输入用户名和密码,能够查询数据库成功,同时记录session数据 1.Login界面,为了只关注主线任务,我直接套用一个bootstrap模板admi ...

  5. 基于struts2的记住账号密码的登录设计

    一个简单的基于struts2的登录功能,实现的额外功能有记住账号密码,登录错误提示.这里写上我在设计时的思路流程,希望大家能给点建设性的意见,帮助我改善设计. 登录功能的制作,首先将jsp界面搭建出来 ...

  6. ASP.NET MVC SSO单点登录设计与实现

    实验环境配置 HOST文件配置如下: 127.0.0.1 app.com127.0.0.1 sso.com IIS配置如下: 应用程序池采用.Net Framework 4.0 注意IIS绑定的域名, ...

  7. ASP.NET MVC SSO单点登录设计与实现(转载)

    实验环境配置 HOST文件配置如下: 127.0.0.1 app.com127.0.0.1 sso.com IIS配置如下: 应用程序池采用.Net Framework 4.0 注意IIS绑定的域名, ...

  8. ASP.NET MVC SSO 单点登录设计与实现

    实验环境配置 HOST文件配置如下: 127.0.0.1 app.com127.0.0.1 sso.com IIS配置如下: 应用程序池采用.Net Framework 4.0 注意IIS绑定的域名, ...

  9. PHP-用ThinkPHP和Bootstrap实现用户登录设计

    一.目标 1.用ThinkPHP和Bootstrap实现用户登录设 2.初步界面如下 二.用到的工具及框架 1.ThinkPHP 2.Bootstrap 3.Subline 三.开发环境搭建 1.下载 ...

随机推荐

  1. BZOJ3500 : PA2008 Cliquers

    设g[i]表示n=i时的答案,则OEIS上可以找到如下递推式: g[i]=g[i-1]+g[i-2]-g[i-5]-g[i-7]+... 其中符号为++--交替,第i项为f[i],f[1]=1,f[2 ...

  2. 使用 IntraWeb (7) - 主模板

    TIWLayoutMgrHTML.TIWTemplateProcessorHTML 属于页面级的模板, 如果要全站统一模板, 当然要用主模板. TIWTemplateProcessorHTML 通过其 ...

  3. 使用 IntraWeb (3) - 页面切换

    新建 StandAlone Application 工程后, 再通过 File > New > Other.. > IntraWeb > New Form 添加两个窗体. 然后 ...

  4. [原创]浅谈H5页面性能优化方法

    [原创]浅谈H5页面性能优化方法 前阶段公司H5页面性能测试,其中测试时也发现了一些性能瓶颈问题,接下来我们在来谈谈H5页面性能优化,仅仅是一些常用H5页面性能优化措施,其实和Web页面性能优化思路大 ...

  5. Android 解压zip文件

    过了n多天后,当再次使用原先博客上写的那篇: Android 压缩解压zip文件 去做zip包的解压的时候,出现了原来没有发现的很多问题.首先是中文汉字问题,使用java的zip包不能很好的解决解压问 ...

  6. 向OSG视图Viewer发送消息

    句柄是以下面的方式传递给osgViewer::Viewer的,osgViewer::View.getCamera().setGraphicsContext(osg::GraphicsContext); ...

  7. After 2 years, I have finally solved my "Slow Hyper-V Guest Network Performance" issue. I am ecstatic.

    Edit - It should be known that I was initially researching this issue back in 2012 and the solution ...

  8. java的异常和java web容器的异常

    一.java的异常,只要catch住异常了,程序就不会挂,依然会执行catch之后的语句 Java程序发生异常就挂了吗? 为了验证程序不会挂,我写了个例子给大家看看. 测试代码: import jav ...

  9. windows nginx出现 was not signaled for 5s的看过来

    windows下 nginx 配置ssl的key是不能存储密码的,否则启动时会提示输入密码 输入后也启动不起来,会报错: 2011/04/18 09:49:09 [alert] 1992#4548: ...

  10. shapefile与字符集编码设置

    在 ArcGIS Desktop (ArcMap, ArcCatalog, and ArcToolbox) 中,有编码页转换功能(CODE PAGE CONVERSION),可以读写多种字符编码的 s ...