TAILIEUCHUNG - Lập trình Androi part 16

Android 1,5 giới thiệu khuôn khổ phương thức nhập liệu (IMF), mà là thường được gọi là bàn phím mềm. Tuy nhiên, thời hạn bàn phím mềm mại không nhất thiết phải chính xác, như IMF có thể được sử dụng để nhận dạng chữ viết tay hoặc các phương tiện khác chấp nhận đầu vào văn bản thông qua màn hình. | Chapter The Input Method Framework Android introduced the input method framework IMF which is commonly referred to as soft keyboards. However the soft keyboard term is not necessarily accurate as IMF could be used for handwriting recognition or other means of accepting text input via the screen. This chapter describes how to use the IMF to tailor software keyboards to your application s needs. Keyboards Hard and Soft Some Android devices like the HTC Magic do not have a hardware keyboard. Other Android devices like the T-Mobile G1 have a hardware keyboard that is visible some of the time when it is slid out . It is likely that in the future there will be Android devices that always have a hardware keyboard available such as netbooks and phones with an always-available QWERTY keyboard beneath the screen . The IMF handles all of these scenarios. In short if there is no hardware keyboard an input method editor IME will be available to users when they tap an enabled EditText. This does not require any code changes to your application as long as the default functionality of the IME is what you want. Fortunately Android is fairly smart about guessing what you want so it may be you can just test with the IME but otherwise make no specific code changes. But the keyboard may not quite behave how you would like to work for your application. For example in the Basic Field sample project the FieldDemo activity has the IME overlaying the multiple-line EditText as shown in Figure 10-1. It would be nice to have more control over how this appears as well as to specify other behavior of the IME. Fortunately the framework as a whole gives you many options for this as is described in this chapter. 117 CHAPTER 10 The Input Method Framework Figure 10-1. The input method editor as seen in the FieldDemo sample application Tailored to Your Needs Android and earlier offered many attributes on EditText widgets to control their style of input such as android password to indicate a .

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.