Click here to Skip to main content
15,890,043 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
How to add Done button to the keyboard will any one explain it elaborately???
Posted
Updated 30-Jun-16 0:46am
Comments
Andy Lanng 20-Aug-15 6:55am    
Get a stick piece of paper. Write the work "done" and stick it to the "any" key on your keyboard.

we can't help unless you explain what you mean elaborately!!!

it is quite simple by doing it in the Interface Builder on the Attribute Inspector or by using the API:

C++
[_textField setReturnKeyType:UIReturnKeyDone];
 
Share this answer
 
well keyboard appears when u will enter text in app.
in iOS we can enter input text using UITextField or by using UITextView.

.h File
Objective-C
#import 

@interface ViewController : UIViewController <uitextfielddelegate,uitextviewdelegate>

@property (strong, nonatomic) IBOutlet UITextField *textField;

@property (strong, nonatomic) IBOutlet UITextView *textView;
@end


.m File
C#
#import "ViewController.h"

@interface ViewController ()

@end

@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view, typically from a nib.
    [self.textField setReturnKeyType:UIReturnKeyDone];
    [self.textView setReturnKeyType:UIReturnKeyDone];
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}


** Dont forgot to add delegate of text field and text view
XML
[self.textField setReturnKeyType:UIReturnKeyDone];
   [self.textView setReturnKeyType:UIReturnKeyDone];
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900