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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T08:12:51+00:00 2026-05-31T08:12:51+00:00

I have a layout problem, I want an image to be in the middle

  • 0

I have a layout problem, I want an image to be in the middle of two buttons. So I created the two buttons and defined a weightSum of 1. I then set the weight of the two buttons to .40 and the image to .20 so that the image would be a small logo in the middle of the two buttons. The problem is the image is stretched out and the buttons are pushed aside.

<Button
    android:id="@+id/buttonClear"
    style="@style/ButtonText"
    android:layout_width="wrap_content"
    android:layout_height="fill_parent"
    android:layout_weight=".40"
    android:background="@drawable/custombuttonred"
    android:text="@string/clear"
    android:textSize="50sp" />

<ImageView
    android:id="@+id/myimage"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_weight=".20"
    android:src="@drawable/imageid" />

<Button
    android:id="@+id/buttonBackspace"
    style="@style/ButtonText"
    android:layout_width="wrap_content"
    android:layout_height="fill_parent"
    android:layout_weight=".40"
    android:background="@drawable/custombuttonred"
    android:text="@string/backspace"
    android:textSize="20sp" />

  • 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-31T08:12:52+00:00Added an answer on May 31, 2026 at 8:12 am

    I had also faced the same issue. I used the button insted of ImageView and set background image to it.

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

Sidebar

Related Questions

I have a layout that is working, but it has one very annoying problem..
I have the age-old problem of a div wrapping a two-column layout. My sidebar
I want to have a grid type layout of image views. To begin i
I have a layout with two ImageView inside. Each image has a fixed aspect
I have a grid layout with image nodes and I want to add in
I am facing the following problem. I have an image Gallery and I want
I have a series of buttons on my website that have I want to
I'm trying to build the simple layout that I have got in the image
I have an annoying CSS layout problem. I'm trying to float images on a
I have a reasonably complex layout problem: I would like to have a main

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.