hold a Widget, and you will be able to posi¬tion it onto your home scr dịch - hold a Widget, and you will be able to posi¬tion it onto your home scr Việt làm thế nào để nói

hold a Widget, and you will be able

hold a Widget, and you will be able to posi¬tion it onto your home screen.
After adding a Widget, you can move it by long-pressing it and dragging it around the screen. To resize (available in Android 3.1 and above), long-press and release. You’ll see small indicators along the edges of the Widget that can be dragged to resize the Widget.
Remove Widgets by dragging them into the garbage can icon or “remove” label at the top or bottom of the screen.
Widgets embedded into an application are hosted within the parent application’s process. They will wake the device based on their update rates to ensure each Widget is up to date when it’s visible. As
a developer, you need to take extra care when creating your Widgets to ensure that the update rate is
as low as possible, and that the code executed within the update method is lightweight.
The following sections show how to create Widgets and describe some best practices for performing updates and adding interactivity.
CREATING APP WIDGETS
App Widgets are implemented as BroadcastReceivers. They use RemoteViews to define and update a view hierarchy hosted within another application process; most commonly that host pro¬cess is the home screen.
To create a Widget for your application, you need to create three components:
1. An XML layout resource that defines the UI
2. An XML file that describes the meta data associated with the Widget
3. A Broadcast Receiver that defines and controls the Widget
You can create as many Widgets as you want for a single application, or you can have an application that consists of a single Widget. Each Widget can use the same size, layout, refresh rate, and update logic, or it can use different ones. In many cases it can be useful to offer multiple versions of your Widgets in different sizes.
Creating the Widget XML Layout Resource
The first step in creating your Widget is to design and implement its user interface (UI).
Construct your Widget’s UI as you would other visual components in Android, as described in Chapter 4, “Building User Interfaces.” Best practice is to define your Widget layout using XML as an external layout resource, but it’s also possible to lay out your UI programmatically within the Broadcast Receiver’s onCreate method.
Widget Design Guidelines
Widgets are often displayed alongside other native and third-party Widgets, so it’s important that yours conform to design standards — particularly because Widgets are most often used on the home screen.
There are UI design guidelines for controlling both a Widget’s layout size and its visual styling. The former is enforced rigidly, whereas the latter is a guide only; both are summarized in the following sections. You can find additional detail on the Android Developers Widget Design Guidelines site, at http://developer.android.com/guide/practices/ui_guidelines/widget_design.html.
Widget Layout Sizes
The default Android home screen is divided into a grid of cells, varying in size and number depend¬ing on the device. It’s best practice to specify a minimum height and width for your Widget that is required to ensure it is displayed in a good default state.
0/5000
Từ: -
Sang: -
Kết quả (Việt) 1: [Sao chép]
Sao chép!
hold a Widget, and you will be able to posi¬tion it onto your home screen.After adding a Widget, you can move it by long-pressing it and dragging it around the screen. To resize (available in Android 3.1 and above), long-press and release. You’ll see small indicators along the edges of the Widget that can be dragged to resize the Widget.Remove Widgets by dragging them into the garbage can icon or “remove” label at the top or bottom of the screen.Widgets embedded into an application are hosted within the parent application’s process. They will wake the device based on their update rates to ensure each Widget is up to date when it’s visible. Asa developer, you need to take extra care when creating your Widgets to ensure that the update rate isas low as possible, and that the code executed within the update method is lightweight.The following sections show how to create Widgets and describe some best practices for performing updates and adding interactivity.CREATING APP WIDGETSApp Widgets are implemented as BroadcastReceivers. They use RemoteViews to define and update a view hierarchy hosted within another application process; most commonly that host pro¬cess is the home screen.To create a Widget for your application, you need to create three components:1. An XML layout resource that defines the UI2. An XML file that describes the meta data associated with the Widget3. A Broadcast Receiver that defines and controls the WidgetYou can create as many Widgets as you want for a single application, or you can have an application that consists of a single Widget. Each Widget can use the same size, layout, refresh rate, and update logic, or it can use different ones. In many cases it can be useful to offer multiple versions of your Widgets in different sizes.Creating the Widget XML Layout ResourceThe first step in creating your Widget is to design and implement its user interface (UI).Construct your Widget’s UI as you would other visual components in Android, as described in Chapter 4, “Building User Interfaces.” Best practice is to define your Widget layout using XML as an external layout resource, but it’s also possible to lay out your UI programmatically within the Broadcast Receiver’s onCreate method.Widget Design GuidelinesWidgets are often displayed alongside other native and third-party Widgets, so it’s important that yours conform to design standards — particularly because Widgets are most often used on the home screen.There are UI design guidelines for controlling both a Widget’s layout size and its visual styling. The former is enforced rigidly, whereas the latter is a guide only; both are summarized in the following sections. You can find additional detail on the Android Developers Widget Design Guidelines site, at http://developer.android.com/guide/practices/ui_guidelines/widget_design.html.Widget Layout SizesThe default Android home screen is divided into a grid of cells, varying in size and number depend¬ing on the device. It’s best practice to specify a minimum height and width for your Widget that is required to ensure it is displayed in a good default state.
đang được dịch, vui lòng đợi..
Kết quả (Việt) 2:[Sao chép]
Sao chép!
giữ một Widget, và bạn sẽ có thể posi¬tion nó vào màn hình chủ của bạn.
Sau khi thêm một Widget, bạn có thể di chuyển nó bằng cách nhấn lâu nó và kéo nó xung quanh màn hình. Để thay đổi kích thước (có sẵn trong Android 3.1 trở lên), dài báo chí và phát hành. Bạn sẽ thấy các chỉ số nhỏ dọc theo các cạnh của các Widget có thể được kéo để thay đổi kích thước các Widget.
Remove Widget bằng cách kéo chúng vào thùng rác có thể biểu tượng hay "loại bỏ" nhãn ở trên cùng hoặc dưới cùng của màn hình.
Widgets nhúng vào một ứng dụng được lưu trữ trong quá trình ứng dụng của cha mẹ. Họ sẽ đánh thức các thiết bị dựa trên tỷ giá cập nhật của họ để đảm bảo mỗi Widget là đến ngày khi nó nhìn thấy được. Là
một nhà phát triển, bạn cần phải chăm sóc thêm khi tạo Widget của bạn để đảm bảo rằng tốc độ cập nhật là
càng thấp càng tốt, và rằng các mã thực thi bên trong phương thức cập nhật là nhẹ.
Các phần sau đây cho thấy làm thế nào để tạo Widget và mô tả một số tốt nhất thực hành để thực hiện cập nhật và thêm tương tác.
TẠO APP vật dụng
App Widgets được thực hiện như BroadcastReceivers. Họ sử dụng RemoteViews để xác định và cập nhật một hệ thống phân cấp xem lưu trữ trong một quá trình ứng dụng; . phổ biến nhất mà chủ pro¬cess là màn hình chủ
Để tạo một Widget cho ứng dụng của bạn, bạn cần phải tạo ra ba thành phần:
1. Một nguồn tài nguyên bố trí XML định nghĩa các giao diện người dùng
2. Một file XML mô tả các dữ liệu meta kết hợp với các Widget
3. Một Broadcast Receiver xác định và kiểm soát các Widget
Bạn có thể tạo nhiều Widget như bạn muốn cho một ứng dụng duy nhất, hoặc bạn có thể có một ứng dụng bao gồm một Widget đơn. Mỗi Widget có thể sử dụng cùng kích thước, bố trí, tốc độ làm tươi, và cập nhật logic, hoặc nó có thể sử dụng những người khác nhau. Trong nhiều trường hợp, nó có thể hữu ích để cung cấp nhiều phiên bản của Widget của bạn trong các kích cỡ khác nhau.
Tạo Widget XML Layout Resource
Bước đầu tiên trong việc tạo Widget của bạn là thiết kế và thực hiện các giao diện người dùng của nó (UI).
Xây dựng giao diện người dùng của Widget của bạn như bạn làm thành phần trực quan khác trong Android, như mô tả trong Chương 4, "Xây dựng giao diện người dùng." thực hành tốt nhất là để xác định bố trí widget bằng cách sử dụng XML như là một nguồn tài nguyên bố trí bên ngoài, nhưng nó cũng có thể đặt ra giao diện người dùng của bạn lập trình trong phương pháp onCreate các Broadcast người nhận .
widget Hướng dẫn thiết kế
Widgets thường được hiển thị bên cạnh Widgets bản địa và bên thứ ba khác, vì vậy điều quan trọng là bạn phù hợp với thiết kế tiêu chuẩn -. đặc biệt là vì Widgets thường được sử dụng trên màn hình chủ
có hướng dẫn thiết kế giao diện người dùng cho việc kiểm soát cả hai bố trí của một widget kích thước và phong cách trực quan của nó. Các cựu được thi hành một cách cứng nhắc, trong khi sau này là một hướng dẫn mà thôi; cả hai đều được tóm tắt trong các phần sau. Bạn có thể tìm thấy chi tiết bổ sung về các trang web phát triển Android Widget Hướng dẫn thiết kế, tại http://developer.android.com/guide/practices/ui_guidelines/widget_design.html.
Widget Layout kích cỡ
màn hình chủ mặc định Android được chia thành một mạng lưới các tế bào , khác nhau về kích thước và số lượng depend¬ing trên thiết bị. Đó là thực hành tốt nhất để xác định một chiều cao và rộng tối thiểu cho Widget của bạn cũng được yêu cầu phải đảm bảo nó được hiển thị trong một trạng thái mặc định tốt.
đ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: