2012-01-11 66 views
2

我正在开发2.1和更高版本的应用程序。此应用中的第一个活动仅支持纵向,因此我在AndroidManifest文件中有android:screenOrientation="portrait"。几乎所有屏幕尺寸和SDK版本的活动看起来都不错,除了WXGA屏幕和4.0.3 SDK(也是3.2)。在这个屏幕上,背景和按钮出现扭曲。Android WXGA模拟器在纵向取向失真

因此,我为4.0.3 SDK创建了一个新的空Android项目。在主Activity中的AndroidManifest的main.xml和android:screenOrientation="portrait"字符串中添加RelativeLayout和Button。调试后(WXGA,4.0.3)我得到了同样的结果。

Button distortion in WXGA emulator

如果我改变android:screenOrientation="portrait"别的东西,按钮看起来不错。

与Windows一样。

为什么会发生这种情况?这是模拟器问题?

回答

1

我有一个类似的问题,这发生在各种平板模拟器(如3.0,3.2等),只有在肖像模式。它不会出现在电话版本中(例如蜂窝之前)。下面是布局文件,我做了一个setContentView,导致右下角的文本变形。它可能看起来微不足道,但它也会扭曲ImageViews,Buttons等。我还发现,当我在屏幕底部放置更多视图时,其中一些视图会被剪裁,或者按下按钮时只会部分突出显示。

<?xml version="1.0" encoding="utf-8"?> 
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" 
android:layout_width="fill_parent" 
android:layout_height="fill_parent" 
android:background="#888" > 

<TextView 
    android:text="ABCDEF" 
    android:textSize="24sp" 
    android:textStyle="bold" 
    android:textColor="#FFF" 
    android:background="#000" 
    android:layout_width="wrap_content" 
    android:layout_height="wrap_content" 
    android:layout_gravity="bottom|right" /> 
</FrameLayout>