AndroidManifest.xml中我的Andr​​oid应用程序并没有真正填满屏幕 [英] Androidmanifest.xml My Android App doesn't really fill the screen

查看:166
本文介绍了AndroidManifest.xml中我的Andr​​oid应用程序并没有真正填满屏幕的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

的屏幕的宽度正确地填充,但不是垂直侧。当我设置的android:anyDensity为true在AndroidManifest.xml中,应用程序的屏幕尽显,但仅限于我的屏幕的左下角:的 http://oi44.tinypic.com/29w7n9v.jpg

有人能告诉我如何使应用程序适合屏幕?
此外,当发生占用整个屏幕播放动画时,我得到的模糊和拉伸图像在屏幕上,如第一张截图链接看到。当我通过moai.exe的OpenGL的模拟器上运行它(我用的摩艾-SDK和拉帕努伊-SDK来开发我的应用程序。我输入他们两个到Eclipse创建APK文件),这不会发生。我不明白,可能是什么问题。

下面是我的Andr​​oidManifest.xml的外观:

 <?XML版本=1.0编码=UTF-8&GT?;
<清单
的xmlns:机器人=htt​​p://schemas.android.com/apk/res/android
安卓的installLocation =自动
安卓版code =1
机器人:=的versionName1.0
包=com.gamefromscratch.moai><支持屏
        机器人:smallScreens =假
        机器人:normalScreens =真
        机器人:largeScreens =假
        机器人:xlargeScreens =假
        机器人:anyDensity =FALSE/><应用
    机器人:图标=@绘制/图标
    机器人:可调试=真
    机器人:启用=真
    机器人:执着=假
    机器人:标签=@字符串/ APP_NAME
    机器人:主题=@安卓风格/ Theme.NoTitleBar.Fullscreen>    <! - 莫埃 - >
    <活动
        机器人:名字=MoaiActivity
        机器人:标签=@字符串/ APP_NAME
        机器人:screenOrientation =画像
        机器人:launchMode =singleTask
        机器人:configChanges =键盘| keyboardHidden |方向>
        &所述;意图滤光器>
            <作用机器人:名字=android.intent.action.MAIN/>
            <类机器人:名字=android.intent.category.LAUNCHER/>
        &所述; /意图滤光器>
    < /活性GT;    <活动
        机器人:名字=com.ziplinegames.moai.MoaiMoviePlayer
        机器人:标签=@字符串/ APP_NAME
        机器人:screenOrientation =画像
        机器人:configChanges =keyboardHidden |方向
        机器人:主题=@安卓风格/ Theme.NoTitleBar>
    < /活性GT;    <接收机器人:名字=com.ziplinegames.moai.MoaiLocalNotificationReceiver>< /接收器>    < - 外部声明:占位符(不要移动或删除) - >< /用途><采用-SDK安卓的minSdkVersion =8机器人:targetSdkVersion =8/><! - 莫埃 - >
<使用许可权的android:NAME =android.permission.ACCESS_NETWORK_STATE/>
<使用许可权的android:NAME =android.permission.INTERNET对/>< - 外部权限:!占位符(不要移动或删除) - ><使用配置的android:reqTouchScreen =手指/>
<使用特征的android:NAME =android.hardware.touchscreen.multitouch机器人:所需=真/>
< /清单>


解决方案

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

 的android:smallScreens =真
 机器人:normalScreens =真
 机器人:largeScreens =真
 机器人:xlargeScreens =真
 机器人:anyDensity =真/>

要避免,你必须与绘制,华电国际,绘制,xhdpi和绘制,xxhdpi文件夹的更多像素创建单独的图像图像模糊的问题。

您可以创建不同尺寸的布局很大,布局XLARGE分离的布局文件夹中。

试试这也,这将解决定位问题
机器人:screenOrientation =未指定
机器人:configChanges =keyboardHidden |方向

希望这将SOVE您的问题。

I am trying to make my app fill the screen for normal displays, but this is the result when I boot it up on my Samsung Captivate i897: http://oi39.tinypic.com/2qamhqd.jpg

The screen's width is filled correctly, but not the vertical side. When I set android:anyDensity to "true" in androidmanifest.xml, the app's screen is fully shown, but only on the bottom-left corner of my screen: http://oi44.tinypic.com/29w7n9v.jpg

Can someone tell me how to make the app fit to screen? Also, when an animation that takes up the whole screen is played, I get blurred and stretched images around the screen, as seen in the first screenshot link. This does not happen when I run it through moai.exe's OpenGL simulator (I am using moai-sdk and rapanui-sdk to develop my app. I imported them both into eclipse to create the apk file). I don't understand what could be the problem.

Here is how my androidmanifest.xml looks:

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

解决方案

following attribute used for supports for multiple screen size, try this

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

To avoid image blurring problem you have to create separate images with more pixel for drawable-hdpi,drawable-xhdpi and drawable-xxhdpi folder.

you can create separate layout folder for different size layout-large,layout-xlarge.

try this also, this will solve orientation problem android:screenOrientation="unspecified" android:configChanges="keyboardHidden|orientation"

hope this will sove your problem.

这篇关于AndroidManifest.xml中我的Andr​​oid应用程序并没有真正填满屏幕的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆