Giao thức <GCKUIImagePicker>
Sử dụng bộ sưu tập để sắp xếp ngăn nắp các trang
Lưu và phân loại nội dung dựa trên lựa chọn ưu tiên của bạn.
Một đối tượng dùng để chọn hình ảnh cho một mục đích nhất định từ đối tượng GCKMediaMetadata.
Cách triển khai mặc định được khung nội bộ sử dụng nội bộ, việc này luôn chọn hình ảnh đầu tiên từ siêu dữ liệu cho mọi mục đích sử dụng. Ứng dụng có thể cung cấp phương thức triển khai tuỳ chỉnh bằng cách đặt thuộc tính GCKCastContext::imagePicker.
- Since
- 3.0
Kế thừa <NSObject>.
Trả về hình ảnh của loại được chỉ định từ siêu dữ liệu phương tiện.
- Parameters
-
imageHints | The hints about how to pick the image. |
metadata | The media metadata to pick from. |
- Trả về
- Hình ảnh đã chọn, hoặc
nil
nếu không có hình ảnh thích hợp cho loại đã yêu cầu.
Trừ phi có lưu ý khác, nội dung của trang này được cấp phép theo Giấy phép ghi nhận tác giả 4.0 của Creative Commons và các mẫu mã lập trình được cấp phép theo Giấy phép Apache 2.0. Để biết thông tin chi tiết, vui lòng tham khảo Chính sách trang web của Google Developers. Java là nhãn hiệu đã đăng ký của Oracle và/hoặc các đơn vị liên kết với Oracle.
Cập nhật lần gần đây nhất: 2022-12-06 UTC.
[[["Dễ hiểu","easyToUnderstand","thumb-up"],["Giúp tôi giải quyết được vấn đề","solvedMyProblem","thumb-up"],["Khác","otherUp","thumb-up"]],[["Thiếu thông tin tôi cần","missingTheInformationINeed","thumb-down"],["Quá phức tạp/quá nhiều bước","tooComplicatedTooManySteps","thumb-down"],["Đã lỗi thời","outOfDate","thumb-down"],["Vấn đề về bản dịch","translationIssue","thumb-down"],["Vấn đề về mẫu/mã","samplesCodeIssue","thumb-down"],["Khác","otherDown","thumb-down"]],["Cập nhật lần gần đây nhất: 2022-12-06 UTC."],[[["`GCKUIImagePicker` is a protocol used for selecting images from `GCKMediaMetadata` for display in the Google Cast user interface."],["A default implementation selects the first image from the metadata, but applications can provide a custom implementation for more nuanced image selection."],["The `getImageWithHints:fromMetadata:` method is the core functionality, allowing developers to retrieve an image based on specified criteria (hints) from the metadata."],["By setting the `GCKCastContext::imagePicker` property, developers can customize how images are selected for their Cast application's UI elements."]]],["The `GCKUIImagePicker` protocol is used to select an image from `GCKMediaMetadata`. By default, the framework selects the first image. Applications can implement custom selection logic by setting `GCKCastContext::imagePicker`. The core action is the `getImageWithHints:fromMetadata:` method, which takes `GCKUIImageHints` and `GCKMediaMetadata` as parameters to determine the image. The method returns the selected `GCKImage` or `nil` if no suitable image is found.\n"]]