4

我已经为我在全新的三星 Galaxy Nexus 上开发的 Android 应用程序设置了启动图像。

"launchimage": {
            "android": "images/splash.png",
            "android-landscape": "images/splash.png"
        }, 

当我启动应用程序时,图像显示。

但它并没有像它应该的那样填满屏幕。

图像为 720x1280,这是 Galaxy Nexus 的原始分辨率。

如何显示正确全尺寸的启动图像?

4

3 回答 3

0

其原因似乎是由于设备像素比/像素密度而导致的图像缩小。

示例:三星 Galaxy Nexus 的像素比为 2(来源)。如果您想在横向模式(1280 x 720 像素)下获得全宽启动图像,您需要一个宽度至少为 1280x2 = 2560 像素的图像。对于纵向模式下的全宽,您至少需要720x2 = 1440 像素宽度

于 2012-11-23T13:24:23.060 回答
0

这是在高像素密度屏幕上加载资源的问题 - 它已在 Trigger.io 平台的 v1.4.24 中修复。

http://docs.trigger.io/en/v1.4/release-notes.html#v1-4-24

于 2012-12-20T18:36:10.773 回答
-1

您提供的信息非常少,但据我了解,

如果您在图像视图中设置图像,则应该将 Xml 用于启动图像

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="@drawable/launchimage"
    android:orientation="vertical" >

<ImageView
 android:layout_width="match_parent"
 android:layout_height="match_parent"
 android:src="@drawable/launchimage"
 android:scaleType="fitXY"
/>

<LinearLayout/>

or alertnativiely
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="@drawable/launchimage"
    android:orientation="vertical" >

<LinearLayout/>

LinearLayout 不是强制性的,您可以选择您选择的布局

于 2012-10-12T10:21:40.670 回答