姜饼和豆形软糖的Android字体大小差异问题

时间:2012-12-23 11:37:02

标签: android layout font-size

仿真器/设备规格:

HD​​PI

解决方案 1280 x 800

屏幕尺寸 5.3

以下两个图像是从两个具有上述规格的仿真器中捕获的。除OS版本

外,两个仿真器都具有相同的功能

enter image description here ANDROID 2.3.5(姜饼)

enter image description here ANDROID 4.1.1(果冻豆)

我使用了EditText的自定义背景图片。 对于两个模拟器,EditText android:textAppearance 属性设置为 70sp

所以,我的问题是为什么Jelly Beans的文字大小比姜饼上的文字大小大?

注意:此问题也出现在ICS上。

更新

enter image description here

这是我在编辑EditText背景图片九补丁之后得到的。 该文本不适合EditText

以下是XML中的EditText属性。

 <EditText
        android:id="@+id/phone_number"
        android:layout_width="fill_parent"
        android:layout_height="150dip"
        android:layout_gravity="center"
        android:layout_marginLeft="28dip"
        android:layout_marginRight="28dip"
        android:background="@drawable/lcdscreen_no_glow"
        android:singleLine="true" 
        android:maxLength="12"
        android:inputType="phone"
        android:textAppearance="@style/EditTextStyleMedium"      
        android:gravity="center"
        android:textStyle="bold"
        android:clickable="false"
        android:longClickable="false"
        android:cursorVisible="false"/>

1 个答案:

答案 0 :(得分:1)

  

我使用了EditText的自定义背景图片

该背景图像应该是九个补丁的PNG文件,以便它可以相应地延伸。

  

所以,我的问题是为什么Jelly Beans的文字大小比姜饼上的文字大小大?

如果没有别的,默认字体是不同的。 Android 1.x / 2.x使用Droid字体系列,而Android 4.x使用Ruboto。因为,通过眼球,高度看起来相同,9的Ruboto字形显然更宽。

相关问题