Android currently supports only one MapActivity and one MapView per ap dịch - Android currently supports only one MapActivity and one MapView per ap Việt làm thế nào để nói

Android currently supports only one

Android currently supports only one MapActivity and one MapView per application.
Maps and Fragments
Map Views can be included within Fragments, provided that the Fragment is attached to a Map Activity. This can be problematic if you are using the Android Support Library to provide support for Fragments on Android platforms prior to Android 3.0.
In such scenarios, you must choose between having your Activity extend FragmentActivity in order to provide Fragment support, or MapActivity in order to include a Map View element.
At the time of writing, the support library did not include a MapFragment or MapFragmentActivity class to enable the use of Map Views within support library Fragments. As a result, it is not currently possibly to include Map Views within support library Fragments and Fragment Activities.
There are several third-party support libraries that attempt to circumvent this restriction. Alternatively, one approach is to create alternative Activity classes for pre- and post-Honeycomb devices, such that Maps within Fragments are used only where supported.
For the remainder of this chapter where Fragments are discussed, it will be assumed that they are native Fragments on devices targeting Android 3.0 (API level 11) or above.
Configuring and Using Map Views
By default the Map View shows the standard street map (refer to Figure 13-4). In addition you can choose to display a satellite view and the expected traffic overlay, as shown in the following code snippet:
mapView.setSatellite(true);
mapView.setTraffic(true);
You can also query the Map View to find the current and maximum available zoom levels:
0/5000
Từ: -
Sang: -
Kết quả (Việt) 1: [Sao chép]
Sao chép!
Android currently supports only one MapActivity and one MapView per application.Maps and FragmentsMap Views can be included within Fragments, provided that the Fragment is attached to a Map Activity. This can be problematic if you are using the Android Support Library to provide support for Fragments on Android platforms prior to Android 3.0.In such scenarios, you must choose between having your Activity extend FragmentActivity in order to provide Fragment support, or MapActivity in order to include a Map View element.At the time of writing, the support library did not include a MapFragment or MapFragmentActivity class to enable the use of Map Views within support library Fragments. As a result, it is not currently possibly to include Map Views within support library Fragments and Fragment Activities.There are several third-party support libraries that attempt to circumvent this restriction. Alternatively, one approach is to create alternative Activity classes for pre- and post-Honeycomb devices, such that Maps within Fragments are used only where supported.For the remainder of this chapter where Fragments are discussed, it will be assumed that they are native Fragments on devices targeting Android 3.0 (API level 11) or above.Configuring and Using Map ViewsBy default the Map View shows the standard street map (refer to Figure 13-4). In addition you can choose to display a satellite view and the expected traffic overlay, as shown in the following code snippet:mapView.setSatellite(true);mapView.setTraffic(true);You can also query the Map View to find the current and maximum available zoom levels:
đang được dịch, vui lòng đợi..
Kết quả (Việt) 2:[Sao chép]
Sao chép!
Android hiện chỉ hỗ trợ một MapActivity và một MapView cho mỗi ứng dụng.
Maps và mảnh vỡ
đồ xem có thể được bao gồm trong mảnh vỡ, với điều kiện là mảnh vỡ được gắn vào một Hoạt động Map. Điều này có thể có vấn đề nếu bạn đang sử dụng các thư viện hỗ trợ Android để cung cấp hỗ trợ cho các mảnh vỡ trên nền tảng Android trước khi Android 3.0.
Trong tình huống như vậy, bạn phải lựa chọn giữa việc có Hoạt động của bạn mở rộng FragmentActivity để cung cấp hỗ trợ Fragment, hoặc MapActivity để bao gồm một bản đồ phần tử.
Tại thời điểm viết bài, các thư viện hỗ trợ không bao gồm MapFragment hoặc MapFragmentActivity lớp để cho phép việc sử dụng Bản đồ Xem trong Fragments thư viện hỗ trợ. Kết quả là, nó không phải là hiện nay có thể bao gồm Bản đồ Xem trong Fragments thư viện hỗ trợ và hoạt động Fragment.
Có một số thư viện hỗ trợ của bên thứ ba mà cố gắng để phá vỡ sự hạn chế này. Ngoài ra, một trong những cách tiếp cận là để tạo ra các lớp học Hoạt động thay thế cho các thiết bị trước và sau Honeycomb, như vậy là Maps trong Những mảnh vỡ được sử dụng duy nhất mà hỗ trợ.
Đối với phần còn lại của chương này, nơi mảnh vỡ được thảo luận, nó sẽ được giả định rằng họ là những mảnh vỡ bản địa trên các thiết bị nhắm mục tiêu điều hành Android 3.0 (API ở mức 11) hoặc cao hơn.
Cấu hình và sử dụng Bản đồ xem
Theo mặc định, bản đồ cho thấy các bản đồ tiêu chuẩn đường phố (xem hình 13-4). Ngoài ra bạn có thể chọn để hiển thị một cái nhìn hình vệ tinh và các lớp phủ giao thông dự kiến, như thể hiện trong đoạn mã sau:
mapView.setSatellite (true);
mapView.setTraffic (true);
Bạn cũng có thể truy vấn các bản đồ để tìm các hiện tại và mức zoom tối đa có sẵn:
đang được dịch, vui lòng đợi..
 
Các ngôn ngữ khác
Hỗ trợ công cụ dịch thuật: Albania, Amharic, Anh, Armenia, Azerbaijan, Ba Lan, Ba Tư, Bantu, Basque, Belarus, Bengal, Bosnia, Bulgaria, Bồ Đào Nha, Catalan, Cebuano, Chichewa, Corsi, Creole (Haiti), Croatia, Do Thái, Estonia, Filipino, Frisia, Gael Scotland, Galicia, George, Gujarat, Hausa, Hawaii, Hindi, Hmong, Hungary, Hy Lạp, Hà Lan, Hà Lan (Nam Phi), Hàn, Iceland, Igbo, Ireland, Java, Kannada, Kazakh, Khmer, Kinyarwanda, Klingon, Kurd, Kyrgyz, Latinh, Latvia, Litva, Luxembourg, Lào, Macedonia, Malagasy, Malayalam, Malta, Maori, Marathi, Myanmar, Mã Lai, Mông Cổ, Na Uy, Nepal, Nga, Nhật, Odia (Oriya), Pashto, Pháp, Phát hiện ngôn ngữ, Phần Lan, Punjab, Quốc tế ngữ, Rumani, Samoa, Serbia, Sesotho, Shona, Sindhi, Sinhala, Slovak, Slovenia, Somali, Sunda, Swahili, Séc, Tajik, Tamil, Tatar, Telugu, Thái, Thổ Nhĩ Kỳ, Thụy Điển, Tiếng Indonesia, Tiếng Ý, Trung, Trung (Phồn thể), Turkmen, Tây Ban Nha, Ukraina, Urdu, Uyghur, Uzbek, Việt, Xứ Wales, Yiddish, Yoruba, Zulu, Đan Mạch, Đức, Ả Rập, dịch ngôn ngữ.

Copyright ©2025 I Love Translation. All reserved.

E-mail: