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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T00:16:08+00:00 2026-06-08T00:16:08+00:00

I was reading on the Android documentation page for Supporting Multiple Screens , and

  • 0

I was reading on the Android documentation page for Supporting Multiple Screens, and it states:

“By default, Android scales your bitmap drawables (.png, .jpg, and .gif files) and Nine-Patch drawables (.9.png files) so that they render at the appropriate physical size on each device.”


“The system scales drawable resources to the appropriate size, based on the current screen density, if necessary.”

Lately, we’ve been adding tablet-functionality to our application. In landscape mode (and for portrait too, but I’ll use landscape as an example), we have an image with text on the left side of the screen, and a button on the right. Simple. When developing this XML layout, I get this image (in the Graphical Layout part of Eclipse’s XML editor) of what to expect when running the application on my 10″ tablet:

What I expect to see.

However, when I run my application on my Acer Iconia A200, I get something more like this screenshot:

What I end up seeing.

In fact, the “image” you see in the 2nd screenshot looks almost identical, if not exactly identical, to the size of the image I see on our Android 2.2 MyTouch phone.

Thus, my question is, why would Android not be re-sizing the image as it shows in the graphical layout of the XML editor (like in the first screenshot?)

Things I’ve tried:

  • I’ve added the drawable image, scaled appropriately, to each drawable-_ _ _ _ folder. Still, the image appeared the same.
  • I’ve added the image to just ldpi, hoping it would scale up for a higher resolution tablet – it did not.
  • I currently have that single image in the drawable folder (no extensions). Still, the same behavior persists.

Any suggestions?


EDIT:

Code:

<LinearLayout
    android:id="@+id/leftLayout"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:layout_weight="1"
    android:orientation="vertical" >

    <ImageView
        android:id="@+id/ImageViewLogo"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:layout_marginBottom="4dp"
        android:layout_marginTop="10dp"
        android:background="@android:color/transparent"
        android:contentDescription="@+string/logo"
        android:scaleType="fitCenter"
        android:src="@drawable/logo_red" />

    <RelativeLayout
        android:id="@+id/layoutBelowImage"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        android:layout_marginBottom="20dp"
        android:layout_marginLeft="10dp"
        android:layout_marginRight="10dp"
        android:gravity="center" >

        ... 4 TextViews here...

    </RelativeLayout>
</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-08T00:16:10+00:00Added an answer on June 8, 2026 at 12:16 am

    Use one of the fit scaleTypes on your ImageView. In this case you may wish to use fitCenter to maintain the aspect ratio.

    There are still some inconsistencies between the emulator and real devices.

    To avoid using wrap_content yet maintaining the aspect ratio of the ImageView (with fitCenter), you can try a few things:

    • Set it to fill_parent. Use weights in a LinearLayout (it is advisable to avoid nested weights but not critical).
    • Set it to fill_parent. Make proper use of layout_above and layout_below.
    • Create a custom view that extends ImageView and sets the correct aspect ratio in OnMeasured.
    • Set a fixed width and height dp (the easiest).
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

From reading the documentation for supporting multiple screen sizes, starting with Android 3.2, you
I was reading this documentation page, http://developer.android.com/reference/android/util/Log.html . The section here caught my eye:
I'm wondering how Android's implementation of SQLite handles long Strings. Reading from online documentation
After reading the android documentation about String, which includes this: This class is implemented
I am currently developing my first Android application by reading Dev Documentation at Android
In reading some android documentation, it seems like intent-filter indicates what intents the application
I was reading the Android documentation on the Android developer website and I read
After reading the Android NDK documentation i am a bit confused on this issue.
I've been reading the Android documentation, and they mention support for different screen densities,
I'm new to Android. I've been reading several posts and documentation about Threads/Services, and

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.