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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T03:17:46+00:00 2026-06-02T03:17:46+00:00

I have a strange problem concerning a layout in my Android app (I’m learning

  • 0

I have a strange problem concerning a layout in my Android app (I’m learning it, so ofcourse I’m making a calculator 🙂 ). I have specified all the buttons to be 25% of the width of the row, but when I add the EditText at the top, the first column becomes a lot wider than the other three columns. (The screenshot is from the IntelliJ preview, but when I load the app on my devices the same results shows.

When I remove the EditText this problem disappears. I have tried adding weight attributes to the EditText in the XML, to no avail.

The result:

The result

My Code:

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
              android:layout_width="fill_parent"
              android:layout_height="fill_parent">
    <TableLayout android:layout_height="wrap_content"
                 android:layout_width="fill_parent"
                 android:weightSum="1.0">
        <TableRow android:layout_width="fill_parent"
                  android:weightSum="1.0">
            <EditText android:layout_weight="1.0"
                      android:text="Edit me"></EditText>
        </TableRow>
        <TableRow android:layout_width="fill_parent"
                  android:weightSum="1.0">
            <Button android:text="7"
                    android:layout_weight="0.25"></Button>
            <Button android:text="8"
                    android:layout_weight="0.25"></Button>
            <Button android:text="9"
                    android:layout_weight="0.25"></Button>
            <Button android:text="/"
                    android:layout_weight="0.25"></Button>
        </TableRow>
        <TableRow android:layout_width="fill_parent"
                  android:weightSum="1.0">
            <Button android:text="4"
                    android:layout_weight="0.25"></Button>
            <Button android:text="5"
                    android:layout_weight="0.25"></Button>
            <Button android:text="6"
                    android:layout_weight="0.25"></Button>
            <Button android:text="*"
                    android:layout_weight="0.25"></Button>
        </TableRow>
        <TableRow android:layout_width="fill_parent"
                  android:weightSum="1.0">
            <Button android:text="1"
                    android:layout_weight="0.25"></Button>
            <Button android:text="2"
                    android:layout_weight="0.25"></Button>
            <Button android:text="3"
                    android:layout_weight="0.25"></Button>
            <Button android:text="-"
                    android:layout_weight="0.25"></Button>
        </TableRow>
        <TableRow android:layout_width="fill_parent">
            <Button android:text="0"
                    android:layout_weight="0.25"></Button>
            <Button android:text="."
                    android:layout_weight="0.25"></Button>
            <Button android:text="+/-"
                    android:layout_weight="0.25"></Button>
            <Button android:text="="
                    android:layout_weight="0.25"></Button>
        </TableRow>
    </TableLayout>
</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-02T03:17:47+00:00Added an answer on June 2, 2026 at 3:17 am

    If your edit text fills the entire width of the screen, why not put it outside your table? like this?

    <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
                  android:layout_width="fill_parent"
                  android:layout_height="fill_parent"
                  android:orientation="vertical">
        <EditText android:layout_width="fill_parent"
                  android:layout_height="wrap_content"
                          android:text="Edit me"/>
        <TableLayout android:layout_height="wrap_content"
                     android:layout_width="fill_parent"
                     android:weightSum="1.0">
            <TableRow android:layout_width="fill_parent"
                      android:weightSum="1.0">
                ...
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a strange problem. My app keeps starting in landscape mode. If I
I have a strange problem in an iPhone app I'm developing. I want my
I have a strange problem. I read text from a text file replace all
i have strange problem doing reporting: i have numerous clients with different issued invoices.
I have strange problem with receiving data from socket. On client im using air
I have a strange problem with lxml when using the deployed version of my
I have a strange problem that is only happening in a single location. I
I have a strange problem with some documents on my webpage. My data is
We have a strange problem when implementing sessions with ColdFusion in IE6. After login
I have a strange problem that I could not solve. When I try to

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.