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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T15:07:21+00:00 2026-06-16T15:07:21+00:00

Using these images: (333×300) (1680×1050) and this layout: <?xml version=1.0 encoding=utf-8?> <LinearLayout xmlns:android=http://schemas.android.com/apk/res/android android:layout_width=match_parent

  • 0

Using these images:

enter image description here (333×300)
enter image description here (1680×1050)

and this layout:

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:layout_margin="12dp"
    android:orientation="vertical">

    <LinearLayout 
        android:orientation="horizontal"
        android:layout_width="match_parent" 
        android:layout_height="0dp"
        android:layout_weight="1"
        android:gravity="center">    

        <ImageButton
            android:layout_width="0dp"
            android:layout_height="match_parent"
            android:layout_weight="1"
            android:scaleType="fitCenter"
            android:src="@drawable/apple" />

        <ImageButton
            android:layout_width="0dp"
            android:layout_height="match_parent"
            android:layout_weight="1"
            android:scaleType="fitCenter"
            android:src="@drawable/apple" />
    </LinearLayout>

    <LinearLayout 
        android:orientation="horizontal"
        android:layout_width="match_parent" 
        android:layout_height="0dp"
        android:layout_weight="1"
        android:gravity="center">   

        <ImageButton
            style="@style/OtherButton"
            android:layout_width="0dp"
            android:layout_height="match_parent"
            android:layout_weight="1"
            android:scaleType="fitCenter"
            android:src="@drawable/orange" />

        <ImageButton
            style="@style/OtherButton"
            android:layout_width="0dp"
            android:layout_height="match_parent"
            android:layout_weight="1"
            android:scaleType="fitCenter"
            android:src="@drawable/orange" />

    </LinearLayout>
</LinearLayout>

gives this result:

enter image description here

With only singly-nested layouts, the apple and orange buttons are the same size. After messing around with Eclipse, I’ve noticed the buttons tend to be taller when their images are larger, but the relative proportions don’t seem to follow a particular pattern.

Why do the buttons have different heights? Is there an alternative method I can use that will scale with screen resolution and density?

  • 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-16T15:07:22+00:00Added an answer on June 16, 2026 at 3:07 pm

    Make below change.

    In your main parent Layout make layout_height to android:layout_height="fill_parent"

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

Sidebar

Related Questions

I am trying to cache these images using this code... But i keep getting
Currently i'm using these codes to save my images into NSDocumentDirectory. I use this
i am using asynctask to fetch images from given url.these images are displaying in
In my application I am using Images, these images can be .tga(Targa Graphic) file
I am using the jQuery cycle plugin to cycle through some images. These images
I'm using some semi-transparent PNGs as background-images on various websites. These are usually something
I'm using these very nice demos to add some style to my images. Unfortunately,
I'm using a WrapPanel in WPF to display images. When resizing the form, these
Im using PHP code to create a dropshadow effect on images. I have this
I am using this code below to rotate my jpeg images, the problem is

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.