You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

如何在WFF的AnalogClock中实现配重指针?设置pivotY后指针偏移

Wear OS 时钟指针设置pivotY后偏移问题

我希望指针的一部分延伸到时钟中心的另一侧(非主侧)。Android Developer官方文档给出了设置枢轴点的建议:

指定枢轴点
时针、分针和秒针资源会随时间推移旋转,但指定正确的旋转枢轴点十分重要。
在某些情况下,枢轴点并非恰好位于指针底部,而是水平居中。此时应按<HourHand … pivotY="(pivot_ratio)" />进行设置,其中:pivot_ratio = pivot_height/full_height。

但按照这个方法设置后,指针出现了偏移:
指针偏移效果

以下是我的代码:

<AnalogClock x="0" y="0" width="450" height="450">
            <Variant mode="AMBIENT" target="alpha" value="192" />

            <!-- Main hands -->
            <HourHand resource="hour" x="225" y="35" width="8" height="190" tintColor="#ffffff">
            </HourHand>
            <MinuteHand resource="minute" x="225" y="5" width="4" height="220" tintColor="#ffffff">
            </MinuteHand>
            <SecondHand resource="second" x="225" y="-20" width="3" height="245" tintColor="[CONFIGURATION.themeColor]" pivotY="0.90">
                <Variant mode="AMBIENT" target="alpha" value="0" />
                <Sweep frequency="15" />
            </SecondHand>
</AnalogClock>

内容的提问来源于stack exchange,提问作者MrStickyPiston

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.06.12 01:20:00