hold a Widget, and you will be able to position it onto your home scre dịch - hold a Widget, and you will be able to position it onto your home scre 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 position 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!
Giữ một Widget, và bạn sẽ có thể để vị trí của nó lên màn hình của bạn.Sau khi thêm một phụ tùng, bạn có thể di chuyển nó bằng long ép nó và kéo nó xung quanh màn hình. Để thay đổi kích thước (có sẵn trong Android 3.1 và ở trên), long-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 cỡ các Widget.Loại bỏ các vật dụng bằng cách kéo chúng vào thùng rác có thể icon hoặc "bỏ" các nhãn ở trên cùng hoặc dưới cùng của màn hình.Widget nhúng vào một ứng dụng được lưu trữ trong quá trình ứng dụng phụ huynh. Họ sẽ đánh thức các thiết bị dựa trên tỷ lệ của họ Cập Nhật để đảm bảo mỗi Widget là đến ngày khi nó được nhìn thấy. Nhưmột nhà phát triển, bạn cần phải chăm sóc thêm khi tạo ra các widget của bạn để đảm bảo rằng tỷ lệ Cập Nhậtnhư thấp nhất có thể, và rằng mã thực hiện trong các phương pháp Cập Nhật là trọng lượng nhẹ.Phần sau đây cho thấy làm thế nào để tạo ra các widget và mô tả một số thực tiễn tốt nhất để thực hiện các Cập Nhật và thêm tương tác.VIỆC TẠO RA VẬT DỤNG APPỨng dụng vật dụng được thực hiện như là BroadcastReceivers. Họ sử dụng RemoteViews để xác định và cập nhật một hệ thống phân cấp xem được tổ chức trong quá trình ứng dụng khác; phổ biến nhất pro¬cess máy chủ đó 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 lực bố trí XML định nghĩa giao diện2. một tập tin XML mô tả meta dữ liệu liên kết với các Widget3. một máy thu phát sóng mà xác định và kiểm soát các 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.Phụ tùng bố trí kích thướcMặc định Android màn hình được chia thành một mạng lưới các tế bào, thay đổi kích thước và số lượng depend¬ing trên thiết bị. Đó là các thực hành tốt nhất để xác định chiều cao tối thiểu và độ rộng cho các Widget của bạn đó là cần thiết để đảm bảo nó sẽ được hiển thị trong một trạng thái mặc định.
đ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: