Android SmartWatch 2控件扩展的字体大小问题

Android SmartWatch 2控件扩展的字体大小问题,android,sony,sony-smartwatch,Android,Sony,Sony Smartwatch,我已经编写了一个运行良好的SmartWatch 2控件扩展,但是当应用程序安装在不同的手机上时,我看到了不同的字体大小。大多数情况下,字体显示正确,但在某些手机上,SmartWatch上的字体异常大 以下是文本小部件的XML: <TextView android:id="@+id/watch_main_text" android:layout_width="fill_parent" android:layout_height="wrap_content" a

我已经编写了一个运行良好的SmartWatch 2控件扩展,但是当应用程序安装在不同的手机上时,我看到了不同的字体大小。大多数情况下,字体显示正确,但在某些手机上,SmartWatch上的字体异常大

以下是文本小部件的XML:

<TextView
    android:id="@+id/watch_main_text"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:layout_alignParentBottom="true"
    android:layout_below="@+id/watch_title_bar"
    android:gravity="center"
    android:padding="5dp"
    android:text="@string/watch_choose_workout_string"
    android:textColor="@color/white"
    android:textSize="10sp" />

是否存在某种覆盖XML资源中指定的字体大小的全局字体大小设置


谢谢

试着用px而不是sp来定义文本大小。字体大小因手机而异的原因是,由于分机实际上是在手机上运行的,而不是在手表上运行的,因此即使手表本身大小不变,它也会尝试根据手机来调整资产

最好的方法是使用SmartExtensionUtils项目中定义的@dimen常量

例如:
android:textSize=“@dimen/smart\u watch\u 2\u text\u size\u large”

完美。谢谢你,马林!