Jayendra
Jayendra

Reputation: 73

How to use line break textfield?

I am Create a message application on ios.using textfield to enter message by user.then fire event keyboard enter should start from second line.

please give me a property of line break in textfield.

Upvotes: 0

Views: 5093

Answers (2)

Paresh Navadiya
Paresh Navadiya

Reputation: 38239

Whenever implement line break then use this:

 NSString *strText =  yourTextField.text;
[strText stringByAppendingString:@"\n"]; //just append string with '\n'
yourTextField.text = strText //changed value with line break

It is better to use UITextView as to display more text

Upvotes: 1

Craig
Craig

Reputation: 556

If you want to make a multi line text box use a textview :)

https://developer.apple.com/library/ios/#documentation/uikit/reference/UITextView_Class/Reference/UITextView.html

Make good use of the Dev centre, can find most things in there :]

Upvotes: 1

Related Questions