SUMMARY

In this chapter, you learned various techniques for dealing with the keyboard in your iPhone application. In particular, this chapter showed you how to hide the keyboard when you are done entering data, how to detect the presence or absence of the keyboard, and how to ensure that views are not blocked by the keyboard.

EXERCISES

  1. How do you hide the keyboard for a UITextField object?
  2. How do you detect whether the keyboard is visible or not?
  3. How do you get the size of the keyboard?
  4. How do you display more views than the View window can display at any one time?

    Answers to the exercises can be found in Appendix D.

image WHAT YOU LEARNED IN THIS CHAPTER

TOPIC KEY CONCEPTS
Making the keyboard go away Use the resignFirstResponder method on a UITextField object to resign its First-Responder status.
Displaying the different types of keyboard displayed Modify the keyboard type by changing the text input traits of a UITextField object in the Attributes Inspector window.
Handling the Return key of the keyboard Either handle the Did End On Exit event of a UITextField object or implement the textFieldShouldReturn: method in your View Controller (remember to ensure that your View Controller class is the delegate for the UITextField object).
Making a Scroll View scrollable Set its frame size and content size. As long as the content size is larger than the frame size, the Scroll ...

Get Beginning iOS 5 Application Development now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.