当我为启动屏幕创建9补丁图像时,它对于大型设备来说显得太小了

ste*_*eaw 0 android splash-screen nine-patch

我决定在启动画面上使用9补丁图像。
问题是,在较大的设备上,启动画面太小,我希望我的启动画面占据屏幕的大部分。

在较小的设备上很好。
我认为我没有以正确的方式创建这9个补丁图像。

有人可以将我指向某个站点或使用9个补丁的初始屏幕图像的GitHub存储库吗,该图像占用了所有设备上的大部分屏幕尺寸?

我想把它放在我的应用程序中,看看我做错了什么。

SplashTheme.xml

<resources>
  <style name="SplashTheme" parent="@android:style/Theme.Holo.Light">
    <item name="android:windowBackground">@drawable/splashscreen</item>
    <item name="android:windowNoTitle">true</item>
 </style>
</resources>
Run Code Online (Sandbox Code Playgroud)

splashscreen.xml

<?xml version="1.0" encoding="utf-8" ?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android" >
<item>
    <shape android:shape="rectangle" > //This is so I can have a white background
        <solid android:color="#FFFFFF" />
    </shape>
</item>
<item>
    <bitmap xmlns:android="http://schemas.android.com/apk/res/android"
      android:src="@drawable/splash" 
      android:tileMode="disabled"
      android:gravity="center"
    />
</item>
</layer-list>
Run Code Online (Sandbox Code Playgroud)

Fan*_*mas 7

这个

<item>
    <bitmap xmlns:android="http://schemas.android.com/apk/res/android"
      android:src="@drawable/splash" 
      android:tileMode="disabled"
      android:gravity="center"
    />
</item>
Run Code Online (Sandbox Code Playgroud)

必须更改为

<item>
    <nine-patch xmlns:android="http://schemas.android.com/apk/res/android"
      android:src="@drawable/splash" 
      android:tileMode="disabled"
      android:gravity="center"
    />
</item>
Run Code Online (Sandbox Code Playgroud)

参考:http : //developer.android.com/guide/topics/resources/drawable-resource.html#NinePatch

  • @BobMalooga 链接是 404,我有同样的问题:我的 9 个补丁 png 创建正确,但它们在平板电脑上渲染得太小 (2认同)