Skip to content

Instantly share code, notes, and snippets.

@Arpit360

Arpit360/CodeSnippet

Last active Jul 29, 2016
Embed
What would you like to do?
using System.IO;
using UIKit;
var window = new UIWindow(UIScreen.MainScreen.Bounds);
window.MakeKeyAndVisible();
var controller = new UIViewController();
window.RootViewController = controller;
controller.View.BackgroundColor = UIColor.Magenta;
var name = new UITextField{ Placeholder = "Enter Name", BorderStyle = UITextBorderStyle.RoundedRect, Frame = new CGRect(10, 80, controller.View.Bounds.Width -20, 31.0f)};
controller.View.AddSubview(name);
var email = new UITextField{ Placeholder = "Enter Email", BorderStyle = UITextBorderStyle.RoundedRect, KeyboardType = UIKeyboardType.EmailAddress, Frame = new CGRect(10, 120, controller.View.Bounds.Width -20, 31.0f)};
var password = new UITextField{ Placeholder = "Enter Password", BorderStyle = UITextBorderStyle.RoundedRect, SecureTextEntry = true, Frame = new CGRect(10, 160, controller.View.Bounds.Width - 20, 31.0f)};
var enterButton = UIButton.FromType(UIButtonType.System);
enterButton.Frame = new CGRect(10, 200, controller.View.Bounds.Width - 20, 31.0f);
enterButton.SetTitle ("Submit", UIControlState.Normal);
controller.View.AddSubviews(new UIView[]{email, password, enterButton});
enterButton.TouchUpInside += (object sender, EventArgs e) =>
{
String strtxt = "Email : " + email.Text + " Name " + name.Text;
Console.WriteLine();
lbl.Text = strtxt;
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.