0

我试图让我的应用程序填满正常显示的屏幕,但这是我在三星 Captivate i897 上启动它时的结果:http: //oi39.tinypic.com/2qamhqd.jpg

屏幕的宽度被正确填充,但不是垂直边。当我在 androidmanifest.xml 中将 android:anyDensity 设置为“true”时,应用程序的屏幕会完全显示,但只显示在屏幕的左下角:http: //oi44.tinypic.com/29w7n9v.jpg

有人可以告诉我如何使应用程序适合屏幕吗?此外,当播放占据整个屏幕的动画时,我会在屏幕周围看到模糊和拉伸的图像,如第一个屏幕截图链接所示。当我通过 moai.exe 的 OpenGL 模拟器运行它时不会发生这种情况(我使用 moai-sdk 和 rapanui-sdk 来开发我的应用程序。我将它们都导入到 eclipse 中以创建 apk 文件)。我不明白可能是什么问题。

这是我的 androidmanifest.xml 的外观:

<?xml version="1.0" encoding="utf-8"?>
<manifest 
xmlns:android="http://schemas.android.com/apk/res/android" 
android:installLocation="auto"
android:versionCode="1" 
android:versionName="1.0" 
package="com.gamefromscratch.moai">

<supports-screens 
        android:smallScreens="false"
        android:normalScreens="true"
        android:largeScreens="false"
        android:xlargeScreens="false"
        android:anyDensity="false"/>

<application 
    android:icon="@drawable/icon" 
    android:debuggable="true" 
    android:enabled="true" 
    android:persistent="false" 
    android:label="@string/app_name"
    android:theme="@android:style/Theme.NoTitleBar.Fullscreen">

    <!-- Moai -->
    <activity 
        android:name="MoaiActivity" 
        android:label="@string/app_name" 
        android:screenOrientation= "portrait"
        android:launchMode="singleTask"
        android:configChanges="keyboard|keyboardHidden|orientation">


        <intent-filter>
            <action android:name="android.intent.action.MAIN" />
            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
    </activity>

    <activity 
        android:name="com.ziplinegames.moai.MoaiMoviePlayer"
        android:label="@string/app_name"
        android:screenOrientation="portrait"
        android:configChanges="keyboardHidden|orientation"
        android:theme="@android:style/Theme.NoTitleBar">
    </activity>

    <receiver android:name="com.ziplinegames.moai.MoaiLocalNotificationReceiver"></receiver>

    <!-- EXTERNAL DECLARATIONS: Placeholder (DO NOT MOVE OR REMOVE) -->

</application>

<uses-sdk android:minSdkVersion="8" android:targetSdkVersion="8"/>

<!-- Moai -->
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.INTERNET" />

<!-- EXTERNAL PERMISSIONS: Placeholder (DO NOT MOVE OR REMOVE) -->



<uses-configuration android:reqTouchScreen="finger" />
<uses-feature android:name="android.hardware.touchscreen.multitouch" android:required="true" />
</manifest>   
4

1 回答 1

0

以下属性用于支持多种屏幕尺寸,试试这个

android:smallScreens="true"
 android:normalScreens="true"
 android:largeScreens="true"
 android:xlargeScreens="true"
 android:anyDensity="true"/>

为避免图像模糊问题,您必须为 drawable-hdpi、drawable-xhdpi 和 drawable-xxhdpi 文件夹创建具有更多像素的单独图像。

您可以为不同大小的 layout-large、layout-xlarge 创建单独的布局文件夹。

也试试这个,这将解决方向问题 android:screenOrientation="unspecified" android:configChanges="keyboardHidden|orientation"

希望这能解决您的问题。

于 2013-08-14T09:01:51.860 回答