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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T20:29:23+00:00 2026-05-21T20:29:23+00:00

friends, i have written following layout code and buttons to be displayed on screen

  • 0

enter image description herefriends,

i have written following layout code and buttons to be displayed on screen equally but it not seems to work any one guide me what mistake am i doing?

![<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" 
android:layout_width="fill_parent" 
android:layout_height="fill_parent"
>

    <LinearLayout 
    android:layout_alignParentTop="true" 
    android:layout_centerHorizontal="true"
    android:layout_width="fill_parent" 
    android:layout_height="wrap_content"
    android:orientation="horizontal"
    android:background="@color/color_panel_background"
    >

        <ImageButton 
        android:layout_height="wrap_content" 
        android:id="@+id/currentLocation" 
        android:layout_weight="1"
        android:layout_width="fill_parent"
        android:src="@drawable/current_location_icon"
         />

        <ImageButton 
        android:layout_height="wrap_content" 
        android:id="@+id/searchCity" 
        android:layout_weight="1"
        android:layout_width="fill_parent"
        android:src="@drawable/search_icon"
         />

        <ImageButton 
        android:layout_height="wrap_content" 
        android:id="@+id/home" 
        android:layout_weight="1"
        android:layout_width="fill_parent" 
         android:src="@drawable/home_icon"
        />

    </LinearLayout>

</RelativeLayout>][2]
  • 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-21T20:29:24+00:00Added an answer on May 21, 2026 at 8:29 pm

    The drawable for the middle button is obviously bigger than the other two. You set the height of the buttons with wrap_content, so the middle button gets bigger. Weight has nothing to do with this. Its only defining how much space the item takes when you use fill_parent.
    Easiest way to fix this is either changing the layout_height to a fixed value (use dp as unit)
    or change the size of your drawables making the images all the same size to begin with.

    Thumbs up for the way you asked the question. Screenshot and relevant code. Wish everybody would do that 🙂

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

Sidebar

Related Questions

Friends, I have written the following JavaScript to ascertain which row of an tabular
I have written the following code: #include <iostream> using namespace std; template <class T>
Friends, I have an application, ten pages, but full of buttons(with background images), big
Why it is not allowed to overload = using friend function? I have written
I have successfully constructed something similar to the following code in visual studio 2008:
I have written some code in C++ with a corresponding C interface (i.e C-function
I have written two scripts Write.py and Read.py . Write.py opens friends.txt in append
this is my algorithm that I have written it with my friends (which are
hi friends I have been working WCF since past one week. I have written
I have two professional programmer friends who are going to teach me, and they

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.