Android WXGA emulator gets distortion in portrait orientation

落花浮王杯 提交于 2019-12-11 02:22:59

问题


I'm developing an app for 2.1 and above. First Activity in this app supports only portrait orientation, so I have android:screenOrientation="portrait" in AndroidManifest file. Activity looks good on almost all screen sizes and SDK versions, except WXGA screen and 4.0.3 SDK (also 3.2). On this screen, there were distortions of the background and buttons.

So I create a new empty Android project for 4.0.3 SDK. Add RelativeLayout and Button in the main.xml and android:screenOrientation="portrait" string in the AndroidManifest for main Activity. After debug (WXGA, 4.0.3) I got the same result.

If I change android:screenOrientation="portrait" to something else, the button looks good.

Same thing with Windows.

Why this happens? This is emulator problem?


回答1:


I have a similar issue, and this occurs with various tablet emulators (eg. 3.0, 3.2, etc.) and only in portrait mode. It does not occur for the phone versions (eg. before Honeycomb). Below is the layout file I do a setContentView with resulting in distorted text in the lower right. It may seem trivial, however, it also distorts ImageViews, Buttons, etc. I also found as I place more views at the bottom of the screen, some of them get clipped, or buttons only partially highlight when pressed.

<?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>


来源:https://stackoverflow.com/questions/8812587/android-wxga-emulator-gets-distortion-in-portrait-orientation

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!