Google uses AI technology to translate content into your preferred language. AI translations can contain errors.
处理图片
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
在表盘中使用图片可以真正让表盘生动起来,从全屏背景图片到添加趣味的细节图片,都可以让表盘更具吸引力。
将图片资源放在 res/drawable 文件夹中(例如 res/drawable/face.png),然后按如下方式引用图片:
<PartImage x="0" y="0" width="450" height="450">
<Image resource="watch_face_dial"/>
</PartImage>
与表盘格式中的其他容器一样,PartImage 元素可以通过多种方式进行修改,包括缩放、旋转、转换、着色或遮罩。如需了解详情,请参阅 PartImage 参考文档。
改变背景
一种可以带来趣味的效果是每小时更换一次背景。
这可以通过使用 Images 元素来实现,例如:
<PartImage x="150" y="150" width="150" height="150">
<Images change="ON_NEXT_HOUR">
<Image resource="red"/>
<Image resource="orange"/>
<Image resource="green"/>
</Images>
</PartImage>
本页面上的内容和代码示例受内容许可部分所述许可的限制。Java 和 OpenJDK 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2026-05-05。
[[["易于理解","easyToUnderstand","thumb-up"],["解决了我的问题","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["没有我需要的信息","missingTheInformationINeed","thumb-down"],["太复杂/步骤太多","tooComplicatedTooManySteps","thumb-down"],["内容需要更新","outOfDate","thumb-down"],["翻译问题","translationIssue","thumb-down"],["示例/代码问题","samplesCodeIssue","thumb-down"],["其他","otherDown","thumb-down"]],["最后更新时间 (UTC):2026-05-05。"],[],[]]