0

アプリを通常のディスプレイの画面いっぱいに表示しようとしていますが、これは Samsung 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 に答える