mono touch登录设计
需要对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登录设计的更多相关文章
- RESTful登录设计(基于Spring及Redis的Token鉴权)
转载自:http://www.scienjus.com/restful-token-authorization/ http://m.blog.csdn.net/article/details?id=4 ...
- struts2的记住账号密码的登录设计
一个简单的基于struts2的登录功能,实现的额外功能有记住账号密码,登录错误提示.这里写上我在设计时的思路流程,希望大家能给点建设性的意见,帮助我改善设计. 登录功能的制作,首先将jsp界面搭建出来 ...
- 《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 ...
- Decoration7:注册登录设计
首先顶一个小目标:从前台写入用户数据后,登录的时候输入用户名和密码,能够查询数据库成功,同时记录session数据 1.Login界面,为了只关注主线任务,我直接套用一个bootstrap模板admi ...
- 基于struts2的记住账号密码的登录设计
一个简单的基于struts2的登录功能,实现的额外功能有记住账号密码,登录错误提示.这里写上我在设计时的思路流程,希望大家能给点建设性的意见,帮助我改善设计. 登录功能的制作,首先将jsp界面搭建出来 ...
- ASP.NET MVC SSO单点登录设计与实现
实验环境配置 HOST文件配置如下: 127.0.0.1 app.com127.0.0.1 sso.com IIS配置如下: 应用程序池采用.Net Framework 4.0 注意IIS绑定的域名, ...
- ASP.NET MVC SSO单点登录设计与实现(转载)
实验环境配置 HOST文件配置如下: 127.0.0.1 app.com127.0.0.1 sso.com IIS配置如下: 应用程序池采用.Net Framework 4.0 注意IIS绑定的域名, ...
- ASP.NET MVC SSO 单点登录设计与实现
实验环境配置 HOST文件配置如下: 127.0.0.1 app.com127.0.0.1 sso.com IIS配置如下: 应用程序池采用.Net Framework 4.0 注意IIS绑定的域名, ...
- PHP-用ThinkPHP和Bootstrap实现用户登录设计
一.目标 1.用ThinkPHP和Bootstrap实现用户登录设 2.初步界面如下 二.用到的工具及框架 1.ThinkPHP 2.Bootstrap 3.Subline 三.开发环境搭建 1.下载 ...
随机推荐
- Codeforces Round #368 (Div. 2) A. Brain's Photos 水题
A. Brain's Photos 题目连接: http://www.codeforces.com/contest/707/problem/A Description Small, but very ...
- 事件触发器-----dispatchEvent
不要被标题蒙蔽了,今天的重点不是论述事件触发器,而是说一下dispatchEvent这个东西.好了,先简单做个铺垫,dispatchEvent是作为高级浏览器(如chrome.Firfox等)的事件触 ...
- Java常用加密方案及实现——AES和DES
AES和DES都是对称加密算法,其中DES全称为Data Encryption Standard,AES全称为Advanced Encryption Standard即高级加密标准. DES现在已经不 ...
- What is OpenOCD?
About OpenOCD was created by Dominic Rath as part of a 2005 diploma thesis written at the University ...
- Software UART, Timer, PWM, External Interrupt
How can you add extra hardware UARTs to a 32bit TMS470 ARM7-based microcontroller at zero cost? Solu ...
- [Winform]js与webbrowser交互
摘要 目前项目中采用的方式是内嵌浏览器的方式,打开本地或者互联网上的h5页面.在开发之前做了一下调研.目前常用的在C#封装的浏览器内核中,Chromium 内核封装有Xilium.Cefglue.Ce ...
- .NET Out Of Memory Exception - Used 1.3GB but have 16GB installed
I am getting an Out Of Memory exception in my c# application when the memory usage for the applicati ...
- What is the largest TCP/IP network port number allowable for IPv4
69 down vote The largest port number is an unsigned short 2^16-1: 65535 A registered port is one ass ...
- ASP.NET Identity系列01,揭开神秘面纱
早在2005年的时候,微软随着ASP.NET 推出了membership机制,十年磨一剑,如今的ASP.NET Identity是否足够强大,一起来体会. 在VS2013下新建项目,选择"A ...
- Visual Studio 2012 调试程序加载缓慢,提示正在下载符号
当在Visual Studio 2012中调试程序的时候,整个过程加载缓慢,并且有类似"正在下载符号......"的提示. 这是因为Visual Studio在调试的时候,默认从M ...