tailieunhanh - Programming the iPhone User Experience phần 8

Một bảng trong Cocoa Touch đại diện cho một danh sách theo chiều dọc của các mặt hàng, với từng hạng mục được phân công đến một ô hoặc hàng trong bảng. Nếu danh sách các mục đa chiều, chẳng hạn như một danh sách thư điện tử trong ứng dụng Mail, mỗi ô trong bảng sẽ hiển thị một bản tóm tắt ngắn gọn, nhãn, | Simpo PDF Merge and Split Unregistered Version - http Figure 7-18 shows the custom control. Figure 7-18. Custom scrolling UlControl subclass Tables and Embedded Controls A table in Cocoa Touch represents a vertical list of items with each item assigned to a cell or row in the table. If the list of items is multi-dimensional such as a list of email messages in the Mail application each table cell should display a succinct summary label or other high-level indication of the object assigned to the cell. Users can get additional information for each row by tapping the row. When a user taps the row an event is sent to the delegate of the table which is an object that conforms to the UITableViewDelegate protocol. This protocol defines methods for handling interaction with cells. A table delegate defines the methods it wishes to handle and the table controller automatically handles the communication between the user interface and the delegate. The availability of free implementations of design patterns like the delegate pattern is one of the benefits that Cocoa Touch controller classes offer developers. You can embed UlControl instances in table cells to add functionality within the context of a single row in your dataset. For example users will often need to delete a record using a button as with the Mail application or change the order of rows in a table. The table delegate protocol UITableViewDelegate allows developers to handle user-initiated edits like reordering deletion and insertion of new rows into the table. The controls you use in table cells should be chosen with attention to the interactive nature of the tables and cells themselves. Most tables are embedded in a scrolling view 120 Chapter 7 Interaction Patterns and Controls Download at Simpo PDF Merge and Split Unregistered Version - http that responds to gestures with movement along the y-axis. In those cases it would be difficult to present users with an embedded