Cordova / Ionic框架(Android)-启动画面不成比例

3

我正在开发一个基于Ionic Cordova的应用程序。我创建了一张2208x2208像素的PNG启动屏,然后使用以下命令创建了启动屏:

$ ionic resources

闪屏已经生成,但问题是我的手机上的闪屏被拉伸/压缩了,就像比例失调了一样。

我的config.xml文件里面有以下内容:

<preference name="orientation" value="portrait"/>
  <preference name="webviewbounce" value="false"/>
  <preference name="UIWebViewBounce" value="false"/>
  <preference name="DisallowOverscroll" value="true"/>
  <preference name="BackupWebStorage" value="none"/>
  <preference name="SplashScreen" value="screen"/>
  <preference name="SplashScreenDelay" value="3000"/>
  <preference name="xwalkVersion" value="14+"/>
  <preference name="xwalkCommandLine" value="--disable-pull-to-refresh-effect"/>
  <preference name="xwalkMode" value="embedded"/>      
<platform name="android">
        <icon src="resources/android/icon/drawable-xhdpi-icon.png"/>
        <icon src="resources/android/icon/drawable-ldpi-icon.png" density="ldpi"/>
        <icon src="resources/android/icon/drawable-mdpi-icon.png" density="mdpi"/>
        <icon src="resources/android/icon/drawable-hdpi-icon.png" density="hdpi"/>
        <icon src="resources/android/icon/drawable-xhdpi-icon.png" density="xhdpi"/>
        <icon src="resources/android/icon/drawable-xxhdpi-icon.png" density="xxhdpi"/>
        <icon src="resources/android/icon/drawable-xxxhdpi-icon.png" density="xxxhdpi"/>
        <splash src="resources/android/splash/drawable-port-ldpi-screen.png" density="port-ldpi"/>
        <splash src="resources/android/splash/drawable-port-mdpi-screen.png" density="port-mdpi"/>
        <splash src="resources/android/splash/drawable-port-hdpi-screen.png" density="port-hdpi"/>
        <splash src="resources/android/splash/drawable-port-xhdpi-screen.png" density="port-xhdpi"/>
        <splash src="resources/android/splash/drawable-port-xxhdpi-screen.png" density="port-xxhdpi"/>
        <splash src="resources/android/splash/drawable-port-xxxhdpi-screen.png" density="port-xxxhdpi"/>
      </platform>

这让我感到担忧,因为可能会有很多其他的移动电话也会导致我的启动画面被拉伸,我想 :/

我不明白为什么启动画面看起来如此糟糕,有什么想法吗?

1个回答

2

谢谢,使用这个 https://github.com/junkoro/make-9patched-splash-ionic 已经解决了。 - itsme

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接