在PhoneGap应用程序中启动屏幕大小 [英] Splash Screen Size in PhoneGap App

查看:85
本文介绍了在PhoneGap应用程序中启动屏幕大小的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试在 config.xml 中为我的初始屏幕设置宽度和高度.

I am trying to set a width and a height for my splash screen in my config.xml.

我正在使用 PhoneGap Build ,而PhoneGap版本是 3.7.0 ,目标是 Andoird .

I am using PhoneGap Build and the PhoneGap version is 3.7.0, and the target is Andoird.

初始屏幕始终显示非常失真(即,将始终调整其大小以使其适合整个屏幕).

The splash screen always shows up very distorted (i.e. it will always be resized so it fits the entire screen).

以下内容无效:

<gap:splash src="./assets/img/logos/appLogo.png" width='200' height='100' />

以下内容根本无法显示启动屏幕:

And the following does not make the splash screen show at all:

<gap:splash src="./assets/img/logos/appLogo.png" gap:platform="android"  width='200' height='100' />

推荐答案

您应该为不同的屏幕尺寸提供不同的启动屏幕.

You should provide different splashscreens for different screen sizes.

根据phonegap Wiki( https://github.com/phonegap/phonegap/wiki/App-Splash-Screen-Sizes )的大小应为:

According to the phonegap wiki ( https://github.com/phonegap/phonegap/wiki/App-Splash-Screen-Sizes ) the sizes should be:

LDPI:
Portrait: 200x320px
Landscape: 320x200px
MDPI:
Portrait: 320x480px
Landscape: 480x320px
HDPI:
Portrait: 480x800px
Landscape: 800x480px
XHDPI:
Portrait: 720px1280px
Landscape: 1280x720px
XXHDPI:
Portrait: 960px1600px
Landscape: 1600x960px
XXXHDPI:
Portrait: 1280px1920px
Landscape: 1920x1280px

您可以将config.xml指向您提供的启动屏幕,例如:

You can point in your config.xml to the splashscreens you provide, for example:

<gap:splash src="res/screen/splash_ldpi.png"       gap:platform="android" gap:qualifier="port-ldpi" />
<gap:splash src="res/screen/splash_mdpi.png"       gap:platform="android" gap:qualifier="port-mdpi" />
<gap:splash src="res/screen/splash_hdpi.png"       gap:platform="android" gap:qualifier="port-hdpi" />
<gap:splash src="res/screen/splash_xhdpi.png"       gap:platform="android" gap:qualifier="port-xhdpi" />

这篇关于在PhoneGap应用程序中启动屏幕大小的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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