嗨,我现在正在为android计算器显示器的布局做准备,我刚刚输入了" display -7 ttf“作为显示。这些数字可以用新字体正确地显示在屏幕上,但我不知道为什么在使用新字体后,显示屏幕的高度变得更短、边缘更小。
更重要的是,Eclipse布局中的预览仍然是正确显示的,但是模拟器中的显示被缩短了。
总之,我希望有一个更高的屏幕和边缘的边缘。
布局代码如下所示。会否有人建议作出修订?非常感谢!
主要活动中字体的代码:
Display = (EditText) findViewById(R.id.ansEditText);
Typeface face=Typeface.createFromAsset(getAssets(),"fonts/digital-7 (italic).ttf");
Display.setTypeface(face); 相关布局代码:
<EditText
android:id="@+id/ansEditText"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_gravity="center"
android:layout_span="5"
android:layout_weight="1"
android:background="#FFFFFF"
android:clickable="false"
android:ems="10"
android:focusable="false"
android:gravity="right|center_vertical"
android:inputType="numberDecimal"
android:longClickable="false"
android:textColor="@color/display_text_color"
android:textSize="@dimen/display_text_size"
android:textStyle="bold" >
<requestFocus />
</EditText>发布于 2012-08-22 15:35:24
如果在您的自定义字体中,字母的大小不同于默认字体,则通常会看到差异。但是显示器不会改变大小,它是由硬件属性/仿真器设置提供的,只有EditText会改变。
所以我看到了两个选择
我希望我正确地理解了这个问题(一幅图片将是有用的),我的答案对你有帮助。
https://stackoverflow.com/questions/12075852
复制相似问题