在姜饼和Android的软糖字体大小差异问题 [英] Android font size difference issue on gingerbread and jellybeans

查看:152
本文介绍了在姜饼和Android的软糖字体大小差异问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

模拟器/设备规格:

华电国际

解决方案 1280×800

屏幕大小 5.3

下面两个图像是从两个仿真器与上述规格抓获。两个仿真器有除操作系统版本相同的一切

机器人 2.3.5(姜饼)

机器人 4.1.1(Jelly Bean)的

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

所以,我的问题是,为什么在糖豆文字大小是比华而不实的文字大小大?

请注意:这个问题也是看到ICS

更新:

这是我所制作的EditText背景图像九宫后,现在越来越。
文本不适合里面的EditText

以下是在XML中的EditText属性。

 <的EditText
        机器人:ID =@ + ID / PHONE_NUMBER
        机器人:layout_width =FILL_PARENT
        机器人:layout_height =150dip
        机器人:layout_gravity =中心
        机器人:layout_marginLeft =28DIP
        机器人:layout_marginRight =28DIP
        机器人:背景=@绘制/ lcdscreen_no_glow
        机器人:单线=真
        机器人:最大长度=12
        安卓的inputType =手机
        机器人:textAppearance =@风格/ EditTextStyleMedium
        机器人:比重=中心
        机器人:文字样式=大胆
        机器人:可点击=假
        机器人:longClickable =假
        机器人:cursorVisible =FALSE/>


解决方案

  

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


这背景图片应该是一个九宫PNG文件,以便它可以相应地伸展。


  

所以,我的问题是,为什么在糖豆文字大小是比华而不实的文字大小大?


如果不出意外,默认字体是不同的。 Android版的1.x / 2.x中使用的Droid字体系列,而Android 4.x的使用Ruboto。因为,通过眼球,高度出现同样的Ruboto字形的 9 显然更广。

Emulator/Device Specs:

HDPI

RESOLUTION 1280 x 800

SCREEN SIZE 5.3

Following two images are captured from two emulators with specs mentioned above. Both emulators have everything same except OS version

ANDROID 2.3.5 (Gingerbread)

ANDROID 4.1.1 (Jelly Bean)

I have used a custom background image for EditText. For EditText android:textAppearance property is set to 70sp for both emulators.

So, my question is why on Jelly Beans text size is bigger than text size on gingerbread?

Note: This issue is also seen on ICS.

UPDATE:

This is what i am getting now after making the EditText background image nine-patch. The text is not fit inside the EditText

Following are the EditText properties in XML.

 <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"/>

解决方案

I have used a custom background image for EditText

That background image should be a nine-patch PNG file so that it can stretch accordingly.

So, my question is why on Jelly Beans text size is bigger than text size on gingerbread?

If nothing else, the default font is different. Android 1.x/2.x used the Droid font family, while Android 4.x uses Ruboto. Since, by eyeball, the heights appear the same, the Ruboto glyphs for 9 are apparently wider.

这篇关于在姜饼和Android的软糖字体大小差异问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆