Your code shows that only when button thumb is visually on the left, it's unchecked. But in RTL layout, it should be resolved on the opposite side. This leads to poor compatibility for internationalization purposes. You may check isLayoutRtl() first just like Android's Switch.
Your code shows that only when button thumb is visually on the left, it's unchecked. But in RTL layout, it should be resolved on the opposite side. This leads to poor compatibility for internationalization purposes. You may check isLayoutRtl() first just like Android's Switch.
您的代码显示,只有当按钮拇指在视觉上位于左侧时,它才处于未选中状态。但在RTL布局中,它应该解析在另一侧。这导致国际化方面的兼容性很差。您可以像 Android 的 Switch 一样,先判断 isLayoutRtl()。