+ Reply to Thread
Results 1 to 5 of 5

How To Make UITextField Programmatically (by coding)

This is a discussion on How To Make UITextField Programmatically (by coding) within the iPhone/iPad Programming Tutorials forums, part of the Programming Section category; Hello, Here I will show you how to add a UITextField programmatically. Code: UITextField * textFieldRounded = [[UITextField alloc] initWithFrame:CGRectMake(10, ...

          
   
  1. #1
    The Man Behind It All Fahad's Avatar
    Join Date
    Jun 2009
    Posts
    789

    Default How To Make UITextField Programmatically (by coding)

    Hello,

    Here I will show you how to add a UITextField programmatically.

    Code:
                    UITextField * textFieldRounded = [[UITextField alloc] initWithFrame:CGRectMake(10, 200, 300, 50)];
                    textFieldRounded.borderStyle = UITextBorderStyleRoundedRect;
    		textFieldRounded.textColor = [UIColor blackColor]; //text color
    		textFieldRounded.font = [UIFont systemFontOfSize:17.0];  //font size
    		textFieldRounded.placeholder = @"<enter text>";  //place holder
    		textFieldRounded.backgroundColor = [UIColor whiteColor]; //background color
    		textFieldRounded.autocorrectionType = UITextAutocorrectionTypeNo;	// no auto correction support
    		
    		textFieldRounded.keyboardType = UIKeyboardTypeDefault;  // type of the keyboard
    		textFieldRounded.returnKeyType = UIReturnKeyDone;  // type of the return key
    		
    		textFieldRounded.clearButtonMode = UITextFieldViewModeWhileEditing;	// has a clear 'x' button to the right
    		
    
    		
    		textFieldRounded.delegate = self;	// let us be the delegate so we know when the keyboard's "Done" button is pressed



    MozyMac Founder,Chairman and CEO

    MacBook Pro Unibody late 2008 2.4Ghz 4GB ram 250GB HD

    MozyMac Youtube Channel

  2. #2
    Junior Member
    Join Date
    Jul 2010
    Posts
    1

    Default Nice hopefully it work... i wan to try it...

    Nice hopefully it work... i wan to try it...
    Quote Originally Posted by Fahad View Post
    Hello,

    Here I will show you how to add a UITextField programmatically.

    Code:
                    UITextField * textFieldRounded = [[UITextField alloc] initWithFrame:CGRectMake(10, 200, 300, 50)];
                    textFieldRounded.borderStyle = UITextBorderStyleRoundedRect;
    		textFieldRounded.textColor = [UIColor blackColor]; //text color
    		textFieldRounded.font = [UIFont systemFontOfSize:17.0];  //font size
    		textFieldRounded.placeholder = @"<enter text>";  //place holder
    		textFieldRounded.backgroundColor = [UIColor whiteColor]; //background color
    		textFieldRounded.autocorrectionType = UITextAutocorrectionTypeNo;	// no auto correction support
    		
    		textFieldRounded.keyboardType = UIKeyboardTypeDefault;  // type of the keyboard
    		textFieldRounded.returnKeyType = UIReturnKeyDone;  // type of the return key
    		
    		textFieldRounded.clearButtonMode = UITextFieldViewModeWhileEditing;	// has a clear 'x' button to the right
    		
    
    		
    		textFieldRounded.delegate = self;	// let us be the delegate so we know when the keyboard's "Done" button is pressed

  3. #3
    Junior Member
    Join Date
    Jan 2011
    Posts
    5

    Default

    magnificent

  4. #4
    Junior Member
    Join Date
    Oct 2011
    Location
    291 W DARBY CIR,DOVER,DE-19904,USA
    Posts
    1

    Default

    I was looking for this.It provide good help for my project.
    Last edited by Fahad; 10-29-2011 at 05:23 PM.

  5. #5
    The Man Behind It All Fahad's Avatar
    Join Date
    Jun 2009
    Posts
    789

    Default

    Quote Originally Posted by Abaddonpaul View Post
    I was looking for this.It provide good help for my project.
    You're welcome.



    MozyMac Founder,Chairman and CEO

    MacBook Pro Unibody late 2008 2.4Ghz 4GB ram 250GB HD

    MozyMac Youtube Channel

+ Reply to Thread

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts