Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.


  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

Chapter 11. Mobile > 11.5. A Virtual Keyboard

11.5. A Virtual Keyboard

The iPad comes with a built-in virtual keyboard, but it only displays its keyboard when a user taps in a text field. Short of going native, there is no way to show the keyboard and capture keystrokes on the iPad if your application lets users enter text without tapping in a text field. In fact, the paint application discussed in this chapter and throughout this book is just such an application. After you activate the text icon, you can click anywhere in the drawing canvas, and a cursor will appear. Subsequently you can type—provided that you have a keyboard—and the paint application draws the text, as depicted in Figure 11.11.

image

Figure 11.11. Entering text in the paint application

Because iOS5 only shows the keyboard when a user physically taps into a text field—programmatically giving a text field focus does not show the keyboard—most developers are stuck if they are developing an application that has an alternate text input strategy. However, for developers familiar with Canvas, it’s possible to implement your own keyboard and show it yourself. The next section illustrates how to do that.


  

You are currently reading a PREVIEW of this book.

                                                                                        

Get instant access to over
$1 million worth of books and videos.

  

Start a Free Trial