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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T00:02:04+00:00 2026-05-22T00:02:04+00:00

API 7 (2.1) I’m implementing high resolution images for the drawable-hdpi folder of my

  • 0

API 7 (2.1)

I’m implementing high resolution images for the drawable-hdpi folder of my app.

Along the bottom of my screen I have a LinearLayout with a fill_parent width. Inside, I have 3 LinearLayouts with a weight of 1. Inside these, I have an ImageView. In effect, I have 3 equally sized spaces for 3 images.

    <LinearLayout
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:orientation="horizontal">   
        <LinearLayout
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:layout_weight="1"
            android:gravity="center">
            <ImageView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:src="@drawable/image1"
                />
        </LinearLayout>
        <LinearLayout
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:layout_weight="1"
            android:gravity="center"
            android:padding="0dip">
            <ImageView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:src="@drawable/image2"
                />
        </LinearLayout>
        <LinearLayout
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:layout_weight="1"
            android:gravity="center">
            <ImageView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:src="@drawable/image3"
                />
        </LinearLayout>
    </LinearLayout>

When the phone is in landscape mode, everything looks fine.

When the phone is in portrait mode, the images are scaled down because their widths are too wide for their 1/3rd space on the screen. The images still look fine.

Here’s my problem:

My images scale fine, but it appears the LinearLayouts wrapping each image do not scale their height.

In landscape mode, the top and bottom of the LinearLayouts wrapping the images share an edge. Meaning, the top of the ImageView is aligned with the top of the LinearLayout wrapping it, and the bottom of the ImageView is aligned with the bottom of the LinearLayout wrapping it. In other words, the height of the LinearLayout == the height of the ImageView.

In portrait mode, the top and bottom of the LinearLayouts wrapping the images have a bunch of space between them and the top and bottom of the images, almost like there is padding. In other words, the height of the LinearLayout > the height of the ImageView. This is not desirable.

Any ideas?

It’s almost like it’s sizing the LinearLayout and ImageView, then squishing the ImageView to fit, and then not resizing the 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-05-22T00:02:05+00:00Added an answer on May 22, 2026 at 12:02 am

    You can try to design separate layouts for both orientations. In your project’s res folder make a subfolder named layout-land. There copy or create a new layout with the same name. In this way you would have a complete control over the layout in any orientation.

    Since you are using android:layout_weight="1" shouldn’t linearLayouts equaly split the space hence an extra space would appear?

    EDIT:
    It seems that it is ImageView that expands its height when LinerLayout has weight set. Add this line to each of your ImageViews:

    android:adjustViewBounds=”true”

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

Sidebar

Related Questions

API Level: 12 (Android 3.1) App Background: Through my Android app I am sending
I am using gooleplaces API. I have a response in json, but the problem
The API says that the Alert Dialog can have one, two or three buttons,
Frapi API Documentation Page not workign properly after i have synchronize. but all other
From API level 11 setDividerDrawable() and setShowDividers() was introduced on LinearLayout , enabling the
My API server and My website have 2 different URLs ! E.g : define([
An API defines that a date should be sent as iso8601, but we have
http://api.serviceu.com/rest/events/occurrences?orgkey=613dc2ce-0b32-4926-8e7e-33ee279be1cb i have above xml url that have n number of occurances. I need
API in my example returns id, name pair <categories> <category id=5 name=Bollywood/> <category id=484
Solution: API 11 is needed see answer below! Easy Question: After downloading a File

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.