TAILIEUCHUNG - Lập trình Androi part 31

Một tập hợp các nguồn lực có thể không phù hợp với tất cả các tình huống mà ứng dụng của bạn có thể được sử dụng. Một khu vực rõ ràng đi kèm với nguồn lực và xử lý chuỗi quốc tế hóa (i18n) và nội địa hoá (L10N). Đưa dây tất cả trong một công trình ngôn ngữ mỹ ít nhất, cho nhà phát triển, nhưng chỉ bao gồm một ngôn ngữ. | 208 CHAPTER 20 Working with Resources color name yellow_orange FFD555 color color name forest_green 005500 color color name burnt_umber 8A3324 color resources In a layout you can reference colors as @color . replacing the ellipsis with your unique name for the color . burnt_umber . In Java you reference color resources by the unique name prefixed with . . . Arrays Array resources are designed to hold lists of simple strings such as a list of honorifics Mr. Mrs. Ms. Dr. etc. . In the resource file you need one string-array element per array with a name attribute for the unique name you are giving the array. Then add one or more child item elements each with a single text element containing the value for that entry in the array xml version encoding utf-8 resources string-array name cities item Philadelphia item item Pittsburgh item item Allentown Bethlehem item item Erie item item Reading item item Scranton item item Lancaster item item Altoona item item Harrisburg item string-array string-array name airport_codes item PHL item item PIT item item ABE item item ERI item item RDG item item AVP item item LNS item item AOO item item MDT item string-array resources From your Java code you can then use to get a String of the items in the list. The parameter to getStringArray is your unique name for the array prefixed with . . . Different Strokes for Different Folks One set of resources may not fit all situations where your application may be used. One obvious area comes with string resources and dealing with internationalization I18N CHAPTER 20 Working with Resources 9 and localization L10N . Putting strings all in one language works fine at least for the developer but covers only one language. That is not the only scenario where resources might need to differ though. Here are others Screen orientation Is the screen in a portrait or .

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.