mono touch登录设计
来源:互联网 发布:网络取票没带身份证 编辑:程序博客网 时间:2024/06/04 20:04
需要对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登录设计
- Mono Touch Table应用
- Mono Touch文件下载
- mono touch:Displaying Images
- mono touch :Displaying Alerts
- mono touch: Appearance API
- mono touch隐藏键盘
- mono touch 隐藏键盘
- mono touch中touch触发对象判断
- mono touch中自定义事件
- mono touch后端事件处理
- mono touch 中图片的StretchableImage属性
- mono touch中定器NSTimer,隐藏状态栏
- mono touch中UIProgressView的使用
- mono touch中UISwitch控件的使用
- mono touch中UISegmentedControl控件的使用
- mono touch中,UISlider控件的使用
- mono touch :Creating iOS Applications in Code
- 在mac os下安装maven
- 自适应阈值化 AdaptiveThreshold
- Linux 强行复制
- Android创建启动画面
- cell的循环利用——实现游戏英雄展示界面
- mono touch登录设计
- 嵌入式开发搭建nfs过程中的网络配置
- onmouseover 和 onmouseout onmouseleave
- 在4.0以上系统中应用出现2.3版本的系统UI
- (iOS)基于XMPP协议的简单IM实现
- 错误的排查
- C++ 读取图像(二进制)保存到mysql blob
- 找出1到1000的素数
- 长连接和心跳包