【问题标题】:TextClock is not working in the same format after changing Locale in Kotlin在 Kotlin 中更改区域设置后,TextClock 无法以相同的格式工作
【发布时间】:2020-04-04 08:08:46
【问题描述】:

我正在使用 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"/>

【问题讨论】:

    标签: android kotlin android-widget


    【解决方案1】:

    我已经在我的三星 Galaxy Tab s2 上进行了测试,它运行良好..特定设备设置肯定有问题,只需尝试从设置中更改语言,然后检查时区格式可能是

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-03-12
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2022-01-01
      相关资源
      最近更新 更多