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 8400087
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T21:28:28+00:00 2026-06-09T21:28:28+00:00

I am troubled by how the Android OS is handling resizing on an app

  • 0

I am troubled by how the Android OS is handling resizing on an app of mine. Basically I have a background image that is 480×800 (so 480px wide) and an image that goes at the bottom, also 480px wide.

On the Galaxy S (480×800 screen) everything looks fine, as shown below:

enter image description here

On the Galaxy S3 (720×1280), however, the background is getting stretched to 720px wide but the image at the bottom only to 640px wide, as shown below:

enter image description here

I tried to create a xhdpi folder with 640×960 images, but same thing happens (background stretched to 720px, image only to 640px). I also tried to play with “ScaleType”, but no luck so far.

Does anyone know why the OS would re-size the two images with a different scale, and how to fix it?

Here’s the XML:

<?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"
    android:background="@drawable/bg" >

    <Button
        android:id="@+id/button1"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:background="@drawable/significados"
        android:layout_gravity="center"
        android:layout_marginTop="216dp"
        android:onClick="goToSignificados"
        />

    <Button
        android:id="@+id/button2"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:background="@drawable/ranking"
        android:layout_gravity="center"
        android:onClick="goToRanking"
        />

    <Button
        android:id="@+id/button3"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:background="@drawable/engracados"
        android:layout_gravity="center"
        android:onClick="goToEngracados"
        />

    <ImageView
        android:id="@+id/iv1"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_gravity="center"
        android:layout_marginTop="60dp"
        android:clickable="true"
        android:contentDescription="@string/image"
        android:onClick="goToMarket"
        android:src="@drawable/googleplay" />

</LinearLayout>
  • 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-06-09T21:28:29+00:00Added an answer on June 9, 2026 at 9:28 pm

    You’ll have to post your XMLs to get a more specific answer but basically all “Views” may handle image scaling differently.

    In your example,

    You can make your button stretch all the way by using width = match-parent.

    “Backgrounds” will stretch by default, but can also tile.
    “Buttons” will have a min size of the background size but will stretch when needed (button has too much text)

    As a side note, you shouldn’t depend on the exact pixels of the images. You should look into nine-patch or making tiled backgrounds and make sure you take advantage of things like “match-parent, gravity, etc.”

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

Sidebar

Related Questions

i am developing an android app using phonegap. I have trouble displaying special characters
I have trouble with an Android app keeping a partial wake lock on my
I'm having trouble displaying SOME images on my android app. Just normal display image
I'm having trouble figuring out how to use soundfonts on android (that have a
I'm having trouble with button text alignment in my Android app. I have a
Working on developing a Class for my android app that will randomly generate NPCs
I have some troubles in my Android app. I need to start an intent
I'm having some trouble finding documentation of how to communicate an android app with
I have been having trouble getting the screen dimensions for android. I do not
Especially android-developers :) I have some troubles with application menu which i try to

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.