0

I am trying to create a splash screen with 9patchimage.... its working fine on a tablet device(2048*1536) but on the mobile device(1920x1080p) display image stretching vertically only Here is my 9patch image i am using this image for splash screen

this one is the screenshot from mobile device here you can see its stretching vertically only

here is the XML layout of my splash screen file

<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/splashscreen"
tools:context="app.av.com.app.gui.SplashScreen">

Harvinder Singh
  • 1,919
  • 21
  • 15

1 Answers1

1

Try this:

<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:background="@drawable/splashscreen"
    tools:context="app.av.com.app.gui.SplashScreen">

But I think you should to use a png image with transparent background (remove green)in the middle of screen and setBackgroundColor to green in the all background

Aspicas
  • 4,498
  • 4
  • 30
  • 53
  • your answer is the simple and best method but i am stuck here with 9patchimages.... everyone behind screen knows this method but here the problem is 9patchimage not splash screen – Harvinder Singh Aug 26 '16 at 07:34
  • Yeah, but if your screen have more height than your 9patchImage, always the image was deformed...(In my opinion), or maybe set a `imageView` inside your `FrameLayout` then you can "scale" your image to the all screen...@HarvinderSingh – Aspicas Aug 26 '16 at 07:40