Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6351319
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T21:58:55+00:00 2026-05-24T21:58:55+00:00

My android app currently has two layouts for its splash screen, portrait and landscape.

  • 0

My android app currently has two layouts for its splash screen, portrait and landscape. Both use the same simple format – an image that’s the same size as the screen, held in a simple linear layout:

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
   android:orientation="vertical"
   android:layout_width="fill_parent"
   android:layout_height="fill_parent"
   >
<ImageView
       android:layout_width="fill_parent"
       android:layout_height="fill_parent"
       android:scaleType="fitCenter"
        android:src="@drawable/splash_p"
       />
</LinearLayout>

The image used is 320w x 480h and Android automatically resizes it to fit the screen, irrespective of the screen size of the device. Obviously, the image isn’t as sharp when resized for a tablet for example.

I should point out here that my goal is to reduce the installed size of the final application as much as possible, and I’m aware that I could include different layouts and sizes of the same images for each differing screen size.

My splash screen is made up of the app’s name in the top third of the screen, and then an image in the bottom two thirds of the screen. In order to save memory, I want to crop the app name and the image into two seperate images, and then display them in a linear vertical layout for devices held in portrait mode. I’ll then use a linear horizontal layout of image and then app name for landscape mode.

For the portrait layout I’ve got this:

     <?xml version="1.0" encoding="utf-8"?>
        <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
        android:layout_width="fill_parent" android:layout_height="fill_parent" android:orientation="vertical">
        <LinearLayout android:id="@+id/linearLayout1" android:layout_width="fill_parent"            android:layout_height="wrap_content" android:orientation="vertical">
        <View android:layout_height="45dp" android:layout_width="45dp" />   
        <ImageView android:layout_height="fill_parent" 
        android:src="@drawable/splashtext" 
        android:scaleType="fitCenter" 
        android:layout_gravity="center" 
        android:layout_width="fill_parent"></ImageView>

        <View
        android:layout_height="35dp"
        android:layout_width="35dp" />      

       <ImageView
       android:scaleType="fitCenter"
        android:src="@drawable/splashpic"
       android:layout_height="fill_parent" android:scaleType="fitCenter" android:layout_width="fill_parent" android:layout_gravity="center"/>
</LinearLayout>
</LinearLayout>

When I display the above in eclipse, it looks ok for smart phones, but the images are not scaled up when displayed on a tablet, although I’m using the android:scaleType=”fitCenter” argument. I’ve tried using dips instead of fill_parent in the imageview layout_width and layout_height but that doesn’t work either.

What am I doing wrong? Is there another way to do this?

Thanks

I’ve edited the question to include this revised XML based on @KaHa6u ‘s help below. So now I have:

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
   android:layout_width="fill_parent"
   android:layout_height="fill_parent" 
   android:orientation="vertical">
    <LinearLayout android:id="@+id/linearLayout1" 
    android:layout_width="fill_parent" 
    android:layout_height="fill_parent" 
    android:orientation="vertical">
<View
        android:layout_height="15dp"
        android:layout_width="15dp"
 /> 
<ImageView android:layout_height="wrap_content" 
        android:src="@drawable/splashtext" 
        android:adjustViewBounds="true"
        android:scaleType="fitXY" 
        android:layout_gravity="center" 
        android:layout_width="wrap_content" 
        android:layout_weight="1">
        </ImageView>


<View
        android:layout_height="15dp"
        android:layout_width="15dp"
 /> 
<ImageView
       android:scaleType="fitXY"
       android:src="@drawable/splashpic" 
       android:adjustViewBounds="false"
       android:layout_height="wrap_content" 
       android:layout_width="wrap_content" 
       android:layout_weight="4" 
       android:layout_gravity="center"/>
</LinearLayout>
</LinearLayout>

Which scales up vertically, but not horizontally, so I end up with tall thin images when the screen size increases.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T21:58:56+00:00Added an answer on May 24, 2026 at 9:58 pm

    @basinbasin

    I just encountered a situation very similar to the one you explained. I needed to have an ImageView on top of the layout, which had to be stretched ONLY HORIZONTALLY and retain its height when the phone gets into landscape orientation. I succeeded with just this:

    <ImageView
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:src="@drawable/main_header"
        android:scaleType="fitXY"
    />
    

    and, of course, with activity’s attribute:

    <activity android:configChanges="keyboardHidden|orientation">
    

    Hope this helps. Thank you.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

My android app has a two word app name, and the 2nd word doesn't
the graphic designer of the Android app that I'm currently building has come up
I’m working on an android application that currently has two Activities, A and B,
I'm developing an Android project which currently has 4 packages: com.myapp.app.activities com.myapp.app.db com.myapp.app.ws com.myapp.app.utils
I'm currently writing an app in Android that works with the GPS. At the
I've got an Android app which has a periodic background Service. I want this
I'm currently developing my first android app, and my first game. I've been developing
Currently I'm developing a registration form for new user in Android (native app.) and
After Google discontinued its support of Android App Inventor on December 31st 2011, it
I have a problem with an app i'm currently making for Android phones. I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.