tailieunhanh - Programming the iPhone User Experience phần 5

Một loại quan trọng của ứng dụng Cocoa Touch là ứng dụng nhập vai. Bạn có thể nghĩ rằng các trò chơi 2D và 3D, gia tốc các ứng dụng kiểm soát, người chơi phim và máy ảnh như nhập vai các ứng dụng. Nói chung, một | Simpo PDF Merge and Split Unregistered Version - http similar controls. The first is standard the second displays the hot area for receiving touches and the third displays the virtual hit area for active touches. Dragging outside of the area highlighted in the figure cancels the selection. Figure 6-5. Examples of large buttons in the Contacts application Figure 6-6. Hot area and active hot area examples Touch Accuracy 63 Download at Simpo PDF Merge and Split Unregistered Version - http The onscreen keyboard has an elegant solution to the problem of touch area. The size of each button in the keyboard is smaller than the typical adult fingertip. Since the keyboard layout is a standard QWERTY configuration users are familiar with the location of each key. But because the keyboard is displayed on screen the standard home row finger positions and ingrained muscle memory can t help accuracy. Apple allows users to confirm the input of each key by briefly expanding the key graphics above the touch location. This pattern is also used in an enhanced form for special keys such as the .com key added conditionally to the keyboard when the first responder field represents a URL. Figure 6-7 illustrates the touch-and-hold control style. Figure 6-7. A standard touch-and-hold control You can use virtual hit areas to enlarge the hot area for a control without changing the visual interface. You can override the pointInside withEvent or hitTest withEvent method to create a virtual hit area. This method is called for a UlView by its superview property as a part of the responder chain. Returning a NO value from these methods causes the responder chain to move on to the next responder object in the chain. Returning YES allows the responder object to handle the event and terminate the trip up the responder chain. Creating a virtual hit area may be as simple as returning YES for points outside the visible boundaries of the view. 64 Chapter 6 .