在 Kotlin 中更改区域设置后,TextClock 无法以相同的格式工作
TextClock is not working in the same format after changing Locale in Kotlin
我正在使用 hh:mm:ss 格式的 TextClock 来显示当前时间。但是当我将语言环境从英语更改为西班牙语时,TextClock 以错误的格式给出时间,即 hh:mm。这仅在 Samsung Tab 中发生。
<TextClock
android:id="@+id/clockTimeTv"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:fontFamily="@font/regular"
android:text="12:58:18 PM"
android:textColor="@color/dark_grey"
android:textSize="@dimen/_18sdp"
android:textStyle="bold"
android:format12Hour="hh:mm:ss a"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toBottomOf="parent"/>
我已经在我的 samsung galaxy tab s2 上进行了测试,它在这方面工作正常..特定设备设置一定有问题,只需尝试从设置中更改语言,然后检查时区格式可能是
我正在使用 hh:mm:ss 格式的 TextClock 来显示当前时间。但是当我将语言环境从英语更改为西班牙语时,TextClock 以错误的格式给出时间,即 hh:mm。这仅在 Samsung Tab 中发生。
<TextClock
android:id="@+id/clockTimeTv"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:fontFamily="@font/regular"
android:text="12:58:18 PM"
android:textColor="@color/dark_grey"
android:textSize="@dimen/_18sdp"
android:textStyle="bold"
android:format12Hour="hh:mm:ss a"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toBottomOf="parent"/>
我已经在我的 samsung galaxy tab s2 上进行了测试,它在这方面工作正常..特定设备设置一定有问题,只需尝试从设置中更改语言,然后检查时区格式可能是