我已经为我正在三星Galaxy Nexus上开发的Android应用程序设置了启动程序。
"launchimage": {
"android": "images/splash.png",
"android-landscape": "images/splash.png"
},
当我启动应用程序时,会显示图像。
但它并没有像应该的那样填满屏幕。
图像为720x1280,这是Galaxy Nexus的原生分辨率。
如何显示正确的全尺寸洗衣机?
这似乎是由于设备像素比/像素密度导致的图像缩小。
示例:三星Galaxy Nexus的像素比例为2(来源)。如果你想在横向模式下获得全宽启动图像(1280 x 720像素),你需要一张宽度至少为1280x2=2560像素的图像。对于人像模式下的全宽,您需要至少720x2=1440像素的宽度。
这是高像素密度屏幕上的资源加载问题,已在Trigger.io平台的v4.24版本中修复。
http://docs.trigger.io/en/v1.4/release-notes.html#v1-4-24
您提供的信息非常少,但据我所知,
如果要在图像视图中设置图像您应该将启动映像的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不是强制性的,您可以选择您选择的布局