string.xml中的标签<font size =“15”> </font>是否符合兼容性?

时间:2017-08-25 09:05:48

标签: android xml fonts

要设置EditText的hintSize,我在string.xml中设置字体大小,如下所示:

<string name="hello_world"><font size="15">Hello world!</font></string>

<EditText>
 android:hint="@string/hello_word"
</EditText>

虽然它可以在不同屏幕的不同设备上正常工作但我会感到困惑吗?

1 个答案:

答案 0 :(得分:0)

  

正确的使用方式

string.xml

<string name="hello_world">Hello world!</string>

style xml

<style name="style">
    <item name="android:textSize">19sp</item>
    <item name="android:textColor">@color/standout_text</item>
    <item name="android:textStyle">bold</item>
</style>
  

TextView

上使用该样式