TAILIEUCHUNG - Lập trình Androi part 08

Quay lại trong Chương 5, bạn đã thấy cách các lĩnh vực có thể có khó khăn đặt vào chúng để hạn chế đầu vào có thể, chẳng hạn như chữ số duy nhất. Những loại khăn giúp người sử dụng "làm cho nó đúng" khi nhập thông tin, đặc biệt là trên các thiết bị di động với bàn phím chật chội. | Chapter Using Selection Widgets Back in Chapter 5 you saw how fields could have constraints placed on them to limit possible input such as only digits. These sorts of constraints help users get it right when entering information particularly on mobile devices with cramped keyboards. Of course the ultimate in constrained input is to allow selection only from a set of items such as a radio button group also discussed in Chapter 5 . Classic UI toolkits have list boxes combo boxes drop-down lists and the like for that very purpose. Android provides many of the same sorts of widgets plus others of particular interest for mobile devices . the Gallery for examining saved photos . Moreover Android offers a flexible framework for determining which choices are available in these widgets. Specifically Android offers a framework of data adapters that provide a common interface for selection lists ranging from static arrays to database contents. Selection views widgets for presenting lists of choices are handed an adapter to supply the actual choices. This chapter begins with a look at Android s adapters and then introduces its selection widgets. Adapting to the Circumstances In the abstract adapters provide a common interface to multiple disparate APIs. More specifically in Android s case adapters provide a common interface to the data model behind a selection-style widget such as a list box. This use of Java interfaces is fairly common . Java Swing s model adapters for JTable and Java is far from the only environment offering this sort of abstraction . Flex s XML data-binding framework accepts XML inlined as static data or retrieved from the Internet . Android s adapters are responsible for providing the roster of data for a selection widget as well as for converting individual elements of data into specific views to be displayed inside the selection widget. The latter facet of the adapter system may sound a little odd but in reality it is not that different from .

TAILIEUCHUNG - Chia sẻ tài liệu không giới hạn
Địa chỉ : 444 Hoang Hoa Tham, Hanoi, Viet Nam
Website : tailieuchung.com
Email : tailieuchung20@gmail.com
Tailieuchung.com là thư viện tài liệu trực tuyến, nơi chia sẽ trao đổi hàng triệu tài liệu như luận văn đồ án, sách, giáo trình, đề thi.
Chúng tôi không chịu trách nhiệm liên quan đến các vấn đề bản quyền nội dung tài liệu được thành viên tự nguyện đăng tải lên, nếu phát hiện thấy tài liệu xấu hoặc tài liệu có bản quyền xin hãy email cho chúng tôi.
Đã phát hiện trình chặn quảng cáo AdBlock
Trang web này phụ thuộc vào doanh thu từ số lần hiển thị quảng cáo để tồn tại. Vui lòng tắt trình chặn quảng cáo của bạn hoặc tạm dừng tính năng chặn quảng cáo cho trang web này.